Exemplo n.º 1
0
 /**
  * @return array[propertyName => Prototype]
  */
 public static function getPropertyPrototypes()
 {
     return ['name' => \Prooph\Processing\Type\String::prototype(), 'age' => \Prooph\Processing\Type\Integer::prototype(), 'created_at' => \Prooph\Processing\Type\DateTime::prototype(), 'price' => \Prooph\Processing\Type\Float::prototype(), 'active' => \Prooph\Processing\Type\Boolean::prototype()];
 }
Exemplo n.º 2
0
 /**
  * @test
  */
 public function it_constructs_a_prototype()
 {
     $dateTimePrototype = DateTime::prototype();
     $this->assertEquals('Prooph\\Processing\\Type\\DateTime', $dateTimePrototype->of());
     $description = $dateTimePrototype->typeDescription();
     $this->assertEquals('DateTime', $description->label());
     $this->assertEquals('datetime', $description->nativeType());
     $this->assertFalse($description->hasIdentifier());
 }
Exemplo n.º 3
0
 /**
  * Returns the prototype of the items type
  *
  * A collection has always one property with name item representing the type of all items in the collection.
  *
  * @return Prototype
  */
 public static function itemPrototype()
 {
     return DateTime::prototype();
 }