Example #1
0
 /**
  * Remove a field
  *
  * @param       $key
  * @param Field $field
  */
 public function removeField($key, Field $field)
 {
     if ($changes = $field->getChanges()) {
         $this->isChanged('fields', array($key, $changes));
     }
     $this->fields->removeElement($field);
 }
Example #2
0
 /**
  * Add fields
  *
  * @param       $key
  * @param Field $field
  *
  * @return Form
  */
 public function addField($key, Field $field)
 {
     if ($changes = $field->getChanges()) {
         $this->isChanged('fields', array($key, $changes));
     }
     $this->fields[$key] = $field;
     return $this;
 }
 /**
  * {@inheritDoc}
  */
 public function getChanges()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getChanges', array());
     return parent::getChanges();
 }