Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Model could not be loaded

Hi,

i try to create a join but the model could not be loaded:

Controller

    use Vokuro\Models\Country;
    use Vokuro\Models\Region;

   $this->modelsManager->createBuilder()
        ->from("Country")
        ->join("Region")
        ->orderBy("Country.country")
        ->getQuery()
        ->execute();

thx



1.7k
Accepted
answer

Use namespaces in from and join also

AS @ntesic said, use the full namespaces in the queryBuilder parameters. From clause should be ->from("Vokuro\Models\Country"). You are registering the namespeces in your contrller, but query builder does not know about them :)



19.6k

Thx a lot will try it next year :-)

Best to you for 2017.



19.6k

Thx to you, now it works. Happy new year.