Hi,
I'm trying modelsManager
in model and getting following error:
( ! ) Fatal error: Cannot redeclare class Apphalcon\Models\Portfolios in D:\wamp\www\webrati\app\models\Portfolios.php on line 178
Here my custom method in Portfolios
model.
public static function getRecents()
{
$modelsManager = Di::getDefault()->getModelsManager();
$phql = " SELECT p.*
FROM portfolios as p
WHERE u.is_active = :active:
ORDER BY p.created DESC";
$query = $modelsManager->createQuery($phql);
$results = $query->execute(
[
'active' => '1'
]
);
return $results;
}
What is missing? Thanks