/var/www/vhosts/nabawater/backend/models
Edit: /var/www/vhosts/nabawater/backend/models/TodaySpecial.php (1606B)
'Vendor Name',
'item_id' => 'Item Name',
'city_id' => 'City Name'
];
}
/**
*
* @return array
*/
public function rules()
{
$rules = [
[['vendor_id'], 'safe'],
['url', 'url'],
[['from_date', 'to_date', 'today_special_status'], 'required'],
[
'url', 'required',
'when' => function ($model) {
return $model->vendor_id === null;
},
'whenClient' => "function(attribute, value) {
return ($('#todayspecial-vendor_id').val() == '') ? true : false;
}"
],
[
'item_id', 'required',
'when' => function ($model) {
return $model->vendor_id != null;
},
'whenClient' => "function(attribute, value) {
return ($('#todayspecial-vendor_id').val() != '') ? true : false;
}"
],
[['from_date', 'to_date'], 'datetime', 'format' => 'php:Y-m-d H:i:s'],
['to_date', 'compare', 'compareAttribute' => 'from_date', 'operator' => '>'],
];
return ArrayHelper::merge(parent::rules(), $rules);
}
}