Esempio n. 1
0
 public static function initialize(AbstractRepo $repo)
 {
     SoftDeleteTrait::initialize($repo);
     $repo->addAsserts([new Present('name'), new Present('other')])->addEventAfter(Event::CONSTRUCT, function ($model) {
         $model->afterConstructCalled = true;
     });
 }
Esempio n. 2
0
 public static function initialize(AbstractRepo $repo)
 {
     SoftDeleteTrait::initialize($repo);
     $repo->setFile('User.json')->addRels([new Rel\One('address', $repo, Address::getRepo()), (new Rel\Many('posts', $repo, Post::getRepo()))->setLinkClass(__NAMESPACE__ . '\\LinkManyPosts')])->addAsserts([new Assert\Present('name')])->addSerializers([new Serializer\Json('profile')]);
 }
Esempio n. 3
0
 public static function initialize(AbstractRepo $repo)
 {
     SoftDeleteTrait::initialize($repo);
     $repo->addRels([new RelOne('one', $repo, Model::getRepo()), new RelMany('many', $repo, Model::getRepo())]);
 }