for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Link between delivery and link
*
* @author Alexey Krupskiy <[email protected]>
* @link http://inji.ru/
* @copyright 2016 Alexey Krupskiy
* @license https://github.com/injitools/cms-Inji/blob/master/LICENSE
*/
namespace Ecommerce\Delivery;
class CityLink extends \Model {
public static $labels = [
'delivery_id' => 'Тип доставки',
'city_id' => 'Город',
'date_create' => 'Дата создания'
];
public static $cols = [
'delivery_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'delivery'],
'city_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'city'],
'weight' => ['type' => 'number'],
'date_create' => ['type' => 'dateTime']
public static $dataManagers = [
'manager' => [
'name' => 'Города доставки',
'cols' => ['city_id', 'date_create'],
'sortMode' => true
]
public static $forms = [
'map' => [
['delivery_id', 'city_id'],
public static function relations() {
return [
'city' => [
'model' => 'Geography\City',
'col' => 'city_id'
],
'delivery' => [
'model' => 'Ecommerce\Delivery',
'col' => 'delivery_id'
}