Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // special case for cactivedataprovider - dont pull active
- // records cause its crazy overhead. bypass that shizzle dawg. tits.
- if($this->dataProvider instanceof CActiveDataProvider) {
- if ($this->convertADPtoCommand) {
- // method you already implemented
- } else {
- // get array of ActiveRecord models
- $models = $this->dataProvider->getData();
- // convert to array
- $data = array();
- $attributes = $this->dataProvider->model->getMetaData()->columns;
- foreach($models as &$model) {
- $row = array();
- foreach($attributes as $attribute=>$col) {
- $row[$attribute] = $model->{$attribute};
- }
- $data[] = $row;
- }
- }
- } else {
- (..)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement