Hello! phalcon resumed his study. please help to understand:
File config:
...
'modelsDir' => __DIR__ . '/../models/',
'viewsDir' => __DIR__ . '/../views/',
'componentsDir' => __DIR__ . '/../components/',
'servicesDir' => __DIR__ . '/../services/',
...
File loader:
...
$loader->registerDirs(
[
$config->phalcon->controllersDir,
$config->phalcon->modelsDir,
]
);
$loader->registerNamespaces(
[
'App\Components' => $config->phalcon->componentsDir,
'App\Services' => $config->phalcon->servicesDir,
'App\Cli' => $config->phalcon->cliDir
]
);
...
file services\Contacts.php :
namespace App\Services;
use App\Components\SalesapCrm;
class Contacts
{
protected $contact;
public function __construct(array $contact){
$this->contact = $contact;
return $this->checkContact();
}
private function checkContact(){
$ContactsModel = \Phalcon\Mvc\Model\Contacts::findFirst('email = "[email protected]"');
return $ContactsModel->getId();
}
}
I get the error:
Uncaught Error: Class 'Phalcon\Mvc\Model\Contacts' not found
I do not understand why can not find a model?