public function populate($arrVals) { $success = parent::populate($arrVals); // attachments foreach ($this->get_attached as $model) { if (!isset($this->{$model})) { $this->{$model} = array(); } } return $success; }