Пример #1
0
 /**
  * @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);
 }
Пример #2
0
 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);
 }
Пример #3
0
 /**
  * @return Webforge\Types\Type
  */
 public function getKeyType($key)
 {
     return $this->meta->getFieldType($key);
 }
Пример #4
0
 public function getFieldType($field)
 {
     return $this->meta->getFieldType($field);
 }