/** * Generally function to create a new custom emotion component field. * * @param array $data * * @return Field */ public function createField(array $data) { $data += array('fieldLabel' => '', 'valueType' => '', 'store' => '', 'supportText' => '', 'helpTitle' => '', 'helpText' => '', 'defaultValue' => '', 'displayField' => '', 'valueField' => '', 'allowBlank' => false); $field = new Field(); $field->fromArray($data); $field->setComponent($this); $this->fields->add($field); return $field; }
/** * Generally function to create a new custom emotion component field. * * @param array $data * * @return Field */ public function createField(array $data) { $data += array('fieldLabel' => '', 'valueType' => '', 'store' => '', 'supportText' => '', 'helpTitle' => '', 'helpText' => '', 'defaultValue' => '', 'displayField' => '', 'valueField' => '', 'allowBlank' => false, 'position' => $this->getMaxPositionValue()); $this->maxFieldPositionValue = max($data['position'], $this->maxFieldPositionValue) + 1; $field = new Field(); $field->fromArray($data); $field->setComponent($this); $this->fields->add($field); return $field; }