예제 #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)]);
 }
예제 #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')]);
 }
예제 #3
0
파일: Product.php 프로젝트: harp-orm/money
 public static function initialize($config)
 {
     CurrencyTrait::initialize($config);
     ValueTrait::initialize($config);
 }
예제 #4
0
 public static function initialize(Config $config)
 {
     ValueTrait::initialize($config);
 }