/** * Getter for array of all fields of model (including inheritated fields) * @return array */ public function getFieldNames() { $fieldNames = array(); foreach ($this->getFields() as $field) { $fieldNames[$field->getName()] = $field->getName(); } if ($this->extends) { $fieldNames = array_merge($fieldNames, $this->extends->getFieldNames()); } return $fieldNames; }