I am trying to get used to using query builder, I have the following query:
$vehicles = $this->modelsManager->createBuilder() ->from('Vehicles') ->join('VehicleTypes', 'Vehicles.vehicle_typeid = VehicleTypes.id') ->orderBy('Vehicles.default_vehicle') ->getQuery() ->execute();
The first question I have is, whether I should be using the table names or the generated model names in the query. (ie. table name is vehicles and the model is Vehicles). Secondly I get the error
Unknown model or alias 'VehicleTypes' do you know why? I referred to docs but couldn't find what I am missing from the code. The final question I have is relating to query performance, what is the best way to execute database queries within Phalcon to ensure best performance for the application?