Hi, I have models/Users.php in Module - auth. I want to call method new Users -> getUser() in Module - profile
How can I do?
P.S.
/modules/auth/models/Users.php
public function getUser($username)
{
$user = Users::findFirst("id = '44'");
return $user;
}
/modules/profile/Module.php
$loader->registerNamespaces(array(
'Auth\Models' => __DIR__ . '/../auth/models/'
));
/modules/profile/controller/indexController.php
$profile = new \Auth\Models\Users();
$profile->getUser($username);
//This return all fields, but it with value = null
But, if i write in modules/profile/indexController:
Users::findFirst("id = '44'"));
//Return all fields with correct data
Help me please :) I want to call model from another Module.
Sorry for my English :)