Ejemplo n.º 1
0
 public static function initialize(Config $config)
 {
     CurrencyTrait::initialize($config);
     ValueTrait::initialize($config);
     SoftDeleteTrait::initialize($config);
     $config->addRels([new Rel\BelongsTo('store', $config, Store::getRepo()), new Rel\HasMany('productItems', $config, ProductItem::getRepo(), ['foreignKey' => 'refId'])])->addAsserts([new Assert\Present('name'), new Assert\LengthLessThan('name', 150)]);
 }
Ejemplo n.º 2
0
 public static function initialize(Config $config)
 {
     ValueTrait::initialize($config);
     TransferTrait::initialize($config);
     TimestampsTrait::initialize($config);
     $config->addRels([new Rel\BelongsTo('storePurchase', $config, StorePurchase::getRepo())])->addAsserts([new Assert\GreaterThan('value', 0), new Assert\Callback('value', function ($refund) {
         return $refund->getValue()->lessThanOrEqual($refund->getStorePurchase()->getRemainingValue());
     }, ':name is more than the remaining value')]);
 }
Ejemplo n.º 3
0
 public static function initialize($config)
 {
     CurrencyTrait::initialize($config);
     ValueTrait::initialize($config);
 }
Ejemplo n.º 4
0
 public static function initialize(Config $config)
 {
     ValueTrait::initialize($config);
 }