From 170e0b8f34373bac8773e43f12d82414ddb43b00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=90=D1=80=D1=82?= =?UTF-8?q?=D0=B0=D1=85=D0=B0=D0=BD=D0=BE=D0=B2?= Date: Mon, 16 Dec 2019 20:08:57 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BF=D0=BE=D0=B4=D0=B4=D0=B5=D1=80=D0=B6=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BA=D0=BE=D0=BF=D1=80=D0=BE=D1=80=D0=B0=D1=82=D0=B8?= =?UTF-8?q?=D0=B2=D0=BD=D1=8B=D1=85=20=D0=BA=D0=BB=D0=B8=D0=B5=D0=BD=D1=82?= =?UTF-8?q?=D0=BE=D0=B2=20=D0=B8=20=D0=B8=D1=85=20=D0=BA=D0=BE=D0=BC=D0=BF?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D0=B9=20=D0=BF=D1=80=D0=B8=20=D1=80=D0=B0?= =?UTF-8?q?=D0=B1=D0=BE=D1=82=D0=B5=20=D1=81=20=D0=BF=D0=BE=D0=BB=D1=8C?= =?UTF-8?q?=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C=D1=81=D0=BA?= =?UTF-8?q?=D0=B8=D0=BC=D0=B8=20=D0=BF=D0=BE=D0=BB=D1=8F=D0=BC=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/RetailCrm/Methods/V5/CustomFields.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/lib/RetailCrm/Methods/V5/CustomFields.php b/lib/RetailCrm/Methods/V5/CustomFields.php index 597a313..0479288 100644 --- a/lib/RetailCrm/Methods/V5/CustomFields.php +++ b/lib/RetailCrm/Methods/V5/CustomFields.php @@ -78,9 +78,12 @@ trait CustomFields ); } - if (empty($entity) || !in_array($entity, ['customer', 'order'])) { + if (empty($entity) || !in_array($entity, ['customer', 'order', 'customer_corporate', 'company'])) { throw new \InvalidArgumentException( - 'Parameter `entity` must contain a data & value must be `order` or `customer`' + sprintf( + 'Parameter `entity` must contain a data & value must be %s', + '`order`, `customer`, `customer_corporate` or `company`' + ) ); } @@ -108,9 +111,12 @@ trait CustomFields ); } - if (empty($entity) || !in_array($entity, ['customer', 'order'])) { + if (empty($entity) || !in_array($entity, ['customer', 'order', 'customer_corporate', 'company'])) { throw new \InvalidArgumentException( - 'Parameter `entity` must contain a data & value must be `order` or `customer`' + sprintf( + 'Parameter `entity` must contain a data & value must be %s', + '`order`, `customer`, `customer_corporate` or `company`' + ) ); } @@ -138,9 +144,12 @@ trait CustomFields ); } - if (empty($entity) || !in_array($entity, ['customer', 'order'])) { + if (empty($entity) || !in_array($entity, ['customer', 'order', 'customer_corporate', 'company'])) { throw new \InvalidArgumentException( - 'Parameter `entity` must contain a data & value must be `order` or `customer`' + sprintf( + 'Parameter `entity` must contain a data & value must be %s', + '`order`, `customer`, `customer_corporate` or `company`' + ) ); }