Yii model to array?
I’m going on the assumption here that you only need to retrieve just the bare arrays, and not any associated model objects. This will do it: $model = Trips::model(); $trips = $model->getCommandBuilder() ->createFindCommand($model->tableSchema, $model->dbCriteria) ->queryAll(); This is like the Yii::app()->db->createCommand(‘SELECT * FROM tbl’)->queryAll(); examples, except: It’ll ask the model for the table name; you won’t … Read more