Esempio n. 1
0
 /**
  * @param UuidInterface $uuid
  * @throws \InvalidArgumentException
  */
 protected function __construct(UuidInterface $uuid)
 {
     parent::__construct($uuid);
     $version = $uuid->getVersion();
     if ($version !== 1) {
         throw new \InvalidArgumentException(sprintf('A time based (version 1) uuid is required.  Version provided [%s].', $version));
     }
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 public function getFields()
 {
     return [Fb::create('_id', T\IdentifierType::create())->required()->withDefault(function () {
         return UuidIdentifier::generate();
     })->className('Gdbots\\Identifiers\\UuidIdentifier')->overridable(true)->build(), Fb::create('status', T\StringEnumType::create())->withDefault(NodeStatus::DRAFT())->className('Gdbots\\Schemas\\Ncr\\Enum\\NodeStatus')->build(), Fb::create('etag', T\StringType::create())->maxLength(100)->pattern('^[\\w\\.:-]+$')->build(), Fb::create('created_at', T\MicrotimeType::create())->build(), Fb::create('creator_ref', T\MessageRefType::create())->build(), Fb::create('updated_at', T\MicrotimeType::create())->useTypeDefault(false)->build(), Fb::create('updater_ref', T\MessageRefType::create())->build(), Fb::create('last_event_ref', T\MessageRefType::create())->build(), Fb::create('title', T\StringType::create())->build()];
 }