Example #1
0
 public function graph()
 {
     return parent::graph()->extend(['User'])->properties(['age' => Type::Integer(), 'email' => Type::String(), 'loggedIn' => Type::Boolean(), 'location' => Type::Object(Location::create()), 'friends' => Type::Collection(Person::create())])->finalize(function (User $instance, $scenario, $data) {
         $instance->email .= '__appended_finalized_value';
     });
 }
 public function graph()
 {
     return Entity::graph(['GraphObjectStep'])->properties(['nested' => Type::Object(GraphObjectNest::create()), 'child' => Type::Object(GraphObjectChild::create()), 'list' => Type::Object(GraphObjectList::create()), 'property' => Type::String()->expected(array('someProperty')), 'anotherProperty' => Type::Integer()->expected(array('someOtherProperty'))]);
 }
 public function graph()
 {
     return Entity::graph(['GraphObjectNest'])->properties(['child' => Type::Object(GraphObjectChild::create()), 'ownProperty' => Type::String()]);
 }
 public function graph()
 {
     return parent::graph()->extend(['GraphObjectExpected'])->properties(['string' => Type::String()->bindTo(['str', 'alphanumeric'])->expected(['__string', 'string__', 'str_val']), 'integer' => Type::Integer()->bindTo(['int'])->expected(['__integer', '__int', 'int_val']), 'simpleCollection' => Type::Collection(GraphSimple::create())->bindTo(['simple_collection', 'simples'])->expected(['simpleData', 'simple_data', 'simple-data']), 'simple' => Type::Object(GraphSimple::create())->bindTo(['GraphSimple', 'simple-val', 'simple.nested'])->expected(['__simple', 'simple__', 'nested.simple'])]);
 }
 public function graph()
 {
     return Entity::graph(['GraphObjectNestedData'])->properties(['_id' => Type::Integer()->bindTo(['id']), 'integer' => Type::Integer()->bindTo(['flatNest.integer']), 'array' => Type::FlatArray()->bindTo(['flatNest.array']), 'anotherInteger' => Type::Integer()->expected(['flatNest.nest.integer']), 'base' => Type::Object(GraphObjectBase::create())->expected(['objectNest.base']), 'child' => Type::Object(GraphObjectChild::create())->bindTo(['objectNest.nest.child']), 'aProperty' => Type::Integer()->bindTo(['preferedproperty'])]);
 }
 public function graph()
 {
     return Entity::graph(['GraphObjectList'])->properties(['assoc' => Type::FlatArray(), 'nest' => Type::Object(GraphObjectNest::create()), 'baseList' => Type::Collection(GraphObjectBase::create())]);
 }
 public function graph()
 {
     return Entity::graph(['Location'])->properties(['point' => Type::Object(Point::create()), 'city' => Type::String(), 'country' => Type::String(), 'address' => Type::String()]);
 }
 public function graph()
 {
     return Entity::graph(['GraphMixed'])->properties(['mixedStandard' => Type::Mixed(), 'mixedCustom' => Type::Mixed(new CustomAdapterTest()), 'mixedCustomProperties' => Type::Mixed(new CustomAdapterTest())->apply(['base' => Type::Object(GraphObjectBase::create())->bindTo(['objectNest.base']), 'simple' => Type::Object(GraphSimple::create()), 'mixedCustom', 'mixedCustom2' => 'nest.mixedCustom2'])]);
 }