Код: Выделить всё
public function rules()
{
return [
[['created_at'], 'safe'],
[['updated_at'], 'safe'],
[['markdel_at'], 'safe'],
[['created_by'], 'integer'],
[['created_by'], 'exist', 'skipOnError' => true, 'targetClass' => User::className(), 'targetAttribute' => ['created_by' => 'id']],
[['updated_by'], 'integer'],
[['updated_by'], 'exist', 'skipOnError' => true, 'targetClass' => User::className(), 'targetAttribute' => ['updated_by' => 'id']],
[['markdel_by'], 'integer'],
[['markdel_by'], 'exist', 'skipOnError' => true, 'targetClass' => User::className(), 'targetAttribute' => ['markdel_by' => 'id']],
[['nomenclature_id'], 'integer'],
[['nomenclature_id'], 'exist', 'skipOnError' => true, 'targetClass' => Nomenclature::className(), 'targetAttribute' => ['nomenclature_id' => 'id']],
[['our_price'], 'number'],
[['lm_price'], 'number'],
[['lm_code'], 'unique'],
[['lm_code'], 'string', 'max' => 20],
[['gamma'], 'string', 'max' => 3],
[['url'], 'string', 'max' => 500],
];
}
наглядно
"разложено по полочкам"
"читабельно"