CDbCriteria Funky

I am trying something very basic with CDbCriteria with unexpected results.

Here is my code:




	public function getSystems() {

		

		$criteria = new CDbCriteria;

		

		$criteria->order = 'sort_order ASC';

		

		$systems = System::model()->findAll($criteria);

		

		return $systems;

	}



$criteria->order is completely ignored and results are returned as they sit in the database.

What am I doing wrong?

Code is OK. Please show your table structure and SQL generated (can be done by enabling profiling).




'db'=>array(

         …

        'enableProfiling'=>true,

        'enableParamLogging' => true,

),

'log'=>array(

    'class'=>'CLogRouter',

    'routes'=>array(

        …

        array(

            'class'=>'CProfileLogRoute',

            'levels'=>'profile',

            'enabled'=>true,

        ),

    ),

),