| @@ 38-49 (lines=12) @@ | ||
| 35 | /** |
|
| 36 | * @inheritdoc |
|
| 37 | */ |
|
| 38 | public function rules() |
|
| 39 | { |
|
| 40 | return [ |
|
| 41 | [['value'], 'string'], |
|
| 42 | [['preload', 'group_id'], 'integer'], |
|
| 43 | [['key'], 'unique'], |
|
| 44 | [['group_id'], 'default', 'value' => 1], |
|
| 45 | [['name', 'key'], 'string', 'max' => 255], |
|
| 46 | [['newGroup'], 'safe'], |
|
| 47 | [['name', 'key', 'preload'], 'safe', 'on' => 'search'] |
|
| 48 | ]; |
|
| 49 | } |
|
| 50 | ||
| 51 | /** |
|
| 52 | * @inheritdoc |
|
| @@ 31-41 (lines=11) @@ | ||
| 28 | /** |
|
| 29 | * @inheritdoc |
|
| 30 | */ |
|
| 31 | public function rules() |
|
| 32 | { |
|
| 33 | return [ |
|
| 34 | [['warehouse_id', 'product_id'], 'required'], |
|
| 35 | [['warehouse_id', 'product_id'], 'integer'], |
|
| 36 | [['in_warehouse', 'reserved_count'], 'number'], |
|
| 37 | [['sku'], 'string', 'max' => 255], |
|
| 38 | [['in_warehouse', 'reserved_count'], 'default', 'value' => 0], |
|
| 39 | [['warehouse_id', 'product_id'], 'unique', 'targetAttribute' => ['warehouse_id', 'product_id'], 'message' => 'The combination of Warehouse ID and Product ID has already been taken.'] |
|
| 40 | ]; |
|
| 41 | } |
|
| 42 | ||
| 43 | /** |
|
| 44 | * @inheritdoc |
|