public static function initialize(Config $config) { TransferTrait::initialize($config); ItemGroupTrait::initialize($config); CurrencyTrait::initialize($config); $config->setTable('Basket')->addRels([new Rel\HasMany('items', $config, ProductItem::getRepo(), ['inverseOf' => 'basket'])]); }
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)]); }
public static function initialize(Config $config) { TransferTrait::initialize($config); ItemGroupTrait::initialize($config); TimestampsTrait::initialize($config); RandomKeyTrait::initialize($config); CurrencyTrait::initialize($config); $config->setTable('Purchase')->addRels([new Rel\HasMany('items', $config, PurchaseItem::getRepo(), ['inverseOf' => 'purchase']), new Rel\HasMany('storePurchases', $config, StorePurchase::getRepo(), ['inverseOf' => 'purchase']), new Rel\BelongsTo('billing', $config, Address::getRepo())]); }
public static function initialize($config) { CurrencyTrait::initialize($config); ValueTrait::initialize($config); }