protected function cleanAttributesAllowed($attributes) { if (sizeof($this->allowed) > 0) { foreach ($attributes as $f => $v) { if (array_search($f, $this->allowed) === false) { unset($attributes[$f]); } } } return $attributes; }