В загрузчике нужно зарегистрировать неймспейс и директорию моделей
$loader = new \Phalcon\Loader();
$loader->registerNamespaces(
[
'App\\Models' => __DIR__ . '/models/',
]
);
$loader->registerDirs(
[
...
__DIR__ . '/models/',
...
]
)->register();
namespace App\Models;
class Accounts extends \Phalcon\Mvc\Model {
public $id;
public $login;
public $password;
public $steam_guard;
public $email;
public $worker_id;
}
use App\Models\Accounts;
class AdminController extends \Phalcon\Mvc\Controller {
public function getAccounts() {
$accounts = Accounts::find();
return $this->response->setJsonContent(['accounts' => $accounts])->send();
}
}