I can’t seem to figure out a way to sort records. I am using Postgres, and my ‘sort’ field criteria are either ignored or cause errors. I am looking for help in adding:
ORDER BY created DESC
to the call below.
$data = new CActiveDataProvider('content',
array(
'criteria' => array( 'condition' => $condition ),
'pagination' => array( 'pageSize' => self::PAGE_SIZE )
)
);
Also, is it possible that some of the ActiveRecord stuff is not yet implemented for Postgres? For example, I can make a condition such as ‘parent_id=42’, but I can’t use the method where you specify an array with ‘parent_id=:pid’ and another with ‘:pid’=>42. The latter method results in an error (“no such index 0”) when attempting to execute the SQL.