public static function cleanFields($fields)
    {
        $fields = parent::cleanFields($fields);

        //If config is requested add id and type as they are need to pull config.
        if (in_array('config', $fields)) {
            $fields[] = 'id';
            $fields[] = 'type';
        }

        //Removing config from field list as it is not a real column in the table.
        if (in_array('config', $fields)) {
            $key = array_keys($fields, 'config');
            unset($fields[$key[0]]);
        }

        return $fields;
    }
public static function cleanFields($fields)
    {
        $fields = parent::cleanFields($fields);

        //If config is requested add id and type as they are need to pull config.
        if (in_array('config', $fields)) {
            $fields[] = 'id';
            $fields[] = 'type';
        }

        //Removing config from field list as it is not a real column in the table.
        if (in_array('config', $fields)) {
            $key = array_keys($fields, 'config');
            unset($fields[$key[0]]);
        }

        return $fields;
    }
public static function cleanFields ( $ fields ) { $ fields = parent :: cleanFields ( $ fields ) ; //If config is requested add id and type as they are need to pull config. if ( in_array ( 'config' , $ fields ) ) { $ fields [ ] = 'id' ; $ fields [ ] = 'type' ; } //Removing config from field list as it is not a real column in the table. if ( in_array ( 'config' , $ fields ) ) { $ key = array_keys ( $ fields , 'config' ) ; unset ( $ fields [ $ key [ 0 ] ] ) ; } return $ fields ; }
Removes 'config' from field list if supplied as it chokes the model.

@param mixed $fields

@return array
Removes config from field list if supplied as it chokes the model .