예제 #1
0
 /**
  * @param FieldInterface|string $childName
  * @return FormInterface|FALSE
  */
 public function remove($childName)
 {
     foreach ($this->children as $child) {
         /** @var FieldInterface $child */
         $isMatchingInstance = TRUE === $childName instanceof FormInterface && $childName->getName() === $child->getName();
         $isMatchingName = $childName === $child->getName();
         if (TRUE === $isMatchingName || TRUE === $isMatchingInstance) {
             $this->children->detach($child);
             $this->children->rewind();
             $child->setParent(NULL);
             return $child;
         }
     }
     return FALSE;
 }
예제 #2
0
파일: Manager.php 프로젝트: atiarda/bolt
 public function addField(FieldInterface $field)
 {
     $this->fields[$field->getName()] = $field;
 }
예제 #3
0
 /**
  * @param FieldInterface $field
  * @param array          $result
  */
 private function fieldToFlatList(FieldInterface $field, array &$result)
 {
     if ($field instanceof CompositeField) {
         foreach ($field->getFields() as $subfield) {
             $this->fieldToFlatList($subfield, $result);
         }
     } else {
         $result[$field->getName()] = $field;
     }
 }