/** * Set or get the row attributes * Differs from parent implementation by allowing the attributes * to be returned by a callback of signature function($row){} */ public function attributes($attributes = null) { // Set dynamic attributes if (is_callable($attributes)) { $this->attr_callback = $attributes; return $this; } // Normal functionality return parent::attributes($attributes); }