for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Warehouse block
*
* @author Alexey Krupskiy <[email protected]>
* @link http://inji.ru/
* @copyright 2015 Alexey Krupskiy
* @license https://github.com/injitools/cms-Inji/blob/master/LICENSE
*/
namespace Ecommerce\Warehouse;
class Block extends \Model
{
public static $cols = [
//Основные параметры
'cart_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'cart'],
'item_offer_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'offer'],
'count' => ['type' => 'text'],
//Системные параметры
'date_create' => ['type' => 'dateTime']
];
public static function relations()
return [
'cart' => [
'model' => 'Ecommerce\Cart',
'col' => 'cart_id'
],
'offer' => [
'model' => 'Ecommerce\Item\Offer',
'col' => 'item_offer_id'
}
public static function indexes()
'ecommerce_warehousesBlockCart' => [
'type' => 'INDEX',
'cols' => [
'warehouse_block_cart_id'
]
'ecommerce_warehousesBlockItem' => [
'warehouse_block_item_offer_id'