order() undefined method
riseoflex88 opened this issue · 1 comments
riseoflex88 commented
I'm getting the following error:
PHP Fatal error: Uncaught Error: Call to undefined method Latitude\\QueryBuilder\\Query\\SelectQuery::order(
When I try to use the order function. Here's a simplified version of my code...
use Latitude\QueryBuilder\Engine\BasicEngine;
use Latitude\QueryBuilder\QueryFactory;
use function Latitude\QueryBuilder\alias;
use function Latitude\QueryBuilder\order;
$builder = new QueryFactory(new BasicEngine());
$query = $builder->select('pc.*')
->from(alias(SHARED_DB.'.programme_cache', 'pc'))
->order('pc.pc_p_id', 'desc')
->compile();
I think I must be getting the syntax of the order function wrong, but the docs doesn't really seem to cover this function very well.
riseoflex88 commented
Found the answer;
Use, 'orderBy()' instead of 'order()'.
Just needs to be updated in the docs here: https://latitude.shadowhand.me/cheatsheet/#ordering