From: Marina Zozirova Date: Thu, 27 Mar 2025 20:41:26 +0000 (+0000) Subject: ERP-377 Убрать возможность создания одинаковых имен. Т.е. можно создать... X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=f58cafc1cd6ae22a8849de136e9c41c3352f3356;p=erp24_rep%2Fyii-erp24%2F.git ERP-377 Убрать возможность создания одинаковых имен. Т.е. можно создать... --- diff --git a/erp24/records/MatrixType.php b/erp24/records/MatrixType.php index d9831c89..a61304bc 100644 --- a/erp24/records/MatrixType.php +++ b/erp24/records/MatrixType.php @@ -49,6 +49,8 @@ class MatrixType extends \yii\db\ActiveRecord public function rules() { return [ + [['name'], 'filter', 'filter' => 'trim'], + [['name'], 'unique', 'targetAttribute' => ['name'], 'message' => 'Имя матрицы уже используется'], [['name'], 'required'], [['created_by', 'updated_by'], 'integer'], [['created_at', 'updated_at'], 'safe'],