| @@ 12-43 (lines=32) @@ | ||
| 9 | */ |
|
| 10 | ||
| 11 | namespace Ecommerce\Catalog; |
|
| 12 | class Category extends \Model { |
|
| 13 | static $cols = [ |
|
| 14 | 'catalog_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'catalog'], |
|
| 15 | 'category_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'category'], |
|
| 16 | ]; |
|
| 17 | static $labels = [ |
|
| 18 | 'category_id' => 'Раздел товаров' |
|
| 19 | ]; |
|
| 20 | static $dataManagers = [ |
|
| 21 | 'manager' => [ |
|
| 22 | 'cols' => ['category_id'] |
|
| 23 | ] |
|
| 24 | ]; |
|
| 25 | static $forms = [ |
|
| 26 | 'manager' => [ |
|
| 27 | 'map' => [['category_id']] |
|
| 28 | ] |
|
| 29 | ]; |
|
| 30 | ||
| 31 | static function relations() { |
|
| 32 | return [ |
|
| 33 | 'catalog' => [ |
|
| 34 | 'col' => 'catalog_id', |
|
| 35 | 'model' => 'Ecommerce\Catalog', |
|
| 36 | ], |
|
| 37 | 'category' => [ |
|
| 38 | 'col' => 'category_id', |
|
| 39 | 'model' => 'Ecommerce\Category', |
|
| 40 | ] |
|
| 41 | ]; |
|
| 42 | } |
|
| 43 | } |
|
| @@ 12-42 (lines=31) @@ | ||
| 9 | namespace Ecommerce\Delivery; |
|
| 10 | ||
| 11 | ||
| 12 | class DisablePayType extends \Model { |
|
| 13 | static $cols = [ |
|
| 14 | 'delivery_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'delivery'], |
|
| 15 | 'paytype_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'payType'], |
|
| 16 | ]; |
|
| 17 | static $dataManagers = [ |
|
| 18 | 'manager' => [ |
|
| 19 | 'cols' => ['paytype_id'] |
|
| 20 | ] |
|
| 21 | ]; |
|
| 22 | static $forms = [ |
|
| 23 | 'manager' => [ |
|
| 24 | 'map' => [ |
|
| 25 | ['paytype_id'] |
|
| 26 | ] |
|
| 27 | ] |
|
| 28 | ]; |
|
| 29 | ||
| 30 | static function relations() { |
|
| 31 | return [ |
|
| 32 | 'delivery' => [ |
|
| 33 | 'col' => 'delivery_id', |
|
| 34 | 'model' => 'Ecommerce\Delivery', |
|
| 35 | ], |
|
| 36 | 'payType' => [ |
|
| 37 | 'col' => 'paytype_id', |
|
| 38 | 'model' => 'Ecommerce\PayType', |
|
| 39 | ] |
|
| 40 | ]; |
|
| 41 | } |
|
| 42 | } |
|
| @@ 14-46 (lines=33) @@ | ||
| 11 | ||
| 12 | namespace Money\Reward; |
|
| 13 | ||
| 14 | class ConditionRewardLnk extends \Model { |
|
| 15 | ||
| 16 | public static $cols = [ |
|
| 17 | 'reward_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'reward'], |
|
| 18 | 'reward_condition_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'condition'], |
|
| 19 | ]; |
|
| 20 | public static $dataManagers = [ |
|
| 21 | 'manager' => [ |
|
| 22 | 'cols' => ['reward_id', 'reward_condition_id'] |
|
| 23 | ] |
|
| 24 | ]; |
|
| 25 | public static $forms = [ |
|
| 26 | 'manager' => [ |
|
| 27 | 'map' => [ |
|
| 28 | ['reward_id', 'reward_condition_id'] |
|
| 29 | ] |
|
| 30 | ] |
|
| 31 | ]; |
|
| 32 | ||
| 33 | public static function relations() { |
|
| 34 | return [ |
|
| 35 | 'reward' => [ |
|
| 36 | 'model' => 'Money\Reward', |
|
| 37 | 'col' => 'reward_id' |
|
| 38 | ], |
|
| 39 | 'condition' => [ |
|
| 40 | 'model' => 'Money\Reward\Condition', |
|
| 41 | 'col' => 'reward_condition_id' |
|
| 42 | ], |
|
| 43 | ]; |
|
| 44 | } |
|
| 45 | ||
| 46 | } |
|
| 47 | ||