Beispiel #1
0
 /**
  * @return Schema
  */
 protected static function defineSchema()
 {
     $schema = new Schema('pbj:gdbots:tests.pbj:fixtures:nested-message:1-0-0', __CLASS__, [Fb::create('test1', T\StringType::create())->build(), Fb::create('test2', T\IntType::create())->asASet()->build(), Fb::create('location', T\GeoPointType::create())->build(), Fb::create('refs', T\MessageRefType::create())->asASet()->build()]);
     MessageResolver::registerSchema($schema);
     return $schema;
 }
Beispiel #2
0
 /**
  * @return Schema
  */
 protected static function defineSchema()
 {
     return new Schema('pbj:gdbots:geo::address:1-0-0', __CLASS__, [Fb::create('geo_hash', T\StringType::create())->maxLength(20)->pattern('^\\w+$')->build(), Fb::create('geo_point', T\GeoPointType::create())->build(), Fb::create('is_verified', T\BooleanType::create())->build(), Fb::create('street1', T\StringType::create())->build(), Fb::create('street2', T\StringType::create())->maxLength(20)->build(), Fb::create('po_box', T\StringType::create())->maxLength(20)->build(), Fb::create('city', T\StringType::create())->maxLength(100)->build(), Fb::create('region', T\StringType::create())->pattern('^[A-Z0-9]{2}$')->build(), Fb::create('region_name', T\StringType::create())->maxLength(150)->build(), Fb::create('postal_code', T\StringType::create())->maxLength(30)->pattern('^[\\w\\s-]+$')->build(), Fb::create('country', T\StringType::create())->pattern('^[A-Z]{2}$')->build(), Fb::create('continent', T\StringType::create())->build()]);
 }