i am getting a fetchAll when using PHQL.
is there anyway to set it to just a fetch?
$result = $this->modelsManager->executeQuery ( $phql , [ "id" => $id ] );
i have to set the results to: return $result[0];
cheers.
try with:
$phql = "SELECT * FROM \Models\News AS n WHERE n.id = :id:";
$singleResult = $this->modelsManager->executeQuery($phql, ['id' => 3])->getFirst();