/** * @depends testConstruct */ public function testGetFieldTypeThrowsFieldNotDefinedException_WithFieldname(SetMeta $meta) { $e = $this->assertException('Psc\\Data\\FieldNotDefinedException', function () use($meta) { $meta->getFieldType(array('ich', 'bin', 'nicht', 'da')); }); $this->assertEquals(array('ich', 'bin', 'nicht', 'da'), $e->field); }
public function export() { $meta = new SetMeta(); foreach ($this->getSetMeta()->getTypes() as $property => $type) { // @TODO schön wäre eigentlich auf ebene 2 immer nur "entity:id" zu exportieren // das müsste dann alle relevanten daten für die response haben if ($type instanceof EntityType || $type instanceof PersistentCollectionType) { continue; } $meta->setFieldType($property, $type); } $set = new Set(array(), $meta); foreach ($set->getKeys() as $property) { $set->set($property, $this->callGetter($property)); } $exporter = new ObjectExporter(); return $exporter->walkWalkable($set); }
/** * @return Webforge\Types\Type */ public function getKeyType($key) { return $this->meta->getFieldType($key); }
public function getFieldType($field) { return $this->meta->getFieldType($field); }