public function processSet(Set $set) { // weil der setter auch enabled sein soll, geht dies hier nicht im konstruktor zu überprüfen if (!$this->entity instanceof \Psc\Doctrine\Entity && !$this->entity instanceof \Psc\Doctrine\Object) { throw new \Psc\Exception('Entity ist kein bekanntes Interface'); } foreach ($set->getMeta()->getTypes() as $field => $type) { $value = $set->get($field); if (isset($this->onFieldTodos[$field])) { call_user_func($this->onFieldTodos[$field], $this->entity, $field, $value, $type); } elseif ($type instanceof PersistentCollectionType) { $this->processCollectionField($this->entity, $field, $value, $type); } else { $this->logf("Setze '%s' auf %s", $field, Code::varInfo($value)); $this->entity->callSetter($field, $value); } } return $this; }
/** * @depends testConstruct */ public function testGetWithMetaButEmptyReturnsNULL(Set $set) { $set->getMeta()->setFieldType('withMetaButEmptyLabel', new StringType()); $this->assertSame(NULL, $set->get('withMetaButEmptyLabel')); }