diff --git a/CRM/Twingle/BAO/TwingleShop.php b/CRM/Twingle/BAO/TwingleShop.php index a4b006c..27ae3b8 100644 --- a/CRM/Twingle/BAO/TwingleShop.php +++ b/CRM/Twingle/BAO/TwingleShop.php @@ -294,7 +294,7 @@ class CRM_Twingle_BAO_TwingleShop extends CRM_Twingle_DAO_TwingleShop { /** * Get associated products. * - * @return array[Civi\Twingle\Shop\BAO\TwingleProduct] + * @return list * @throws \Civi\Core\Exception\DBQueryException * @throws \Civi\Twingle\Shop\Exceptions\ProductException */ diff --git a/CRM/Twingle/Submission.php b/CRM/Twingle/Submission.php index 2c3e85d..1955d18 100644 --- a/CRM/Twingle/Submission.php +++ b/CRM/Twingle/Submission.php @@ -18,7 +18,6 @@ declare(strict_types = 1); use CRM_Twingle_ExtensionUtil as E; use Civi\Twingle\Exceptions\BaseException; use Civi\Twingle\Shop\Exceptions\LineItemException; -use Civi\Twingle\Shop\BAO\TwingleProduct; class CRM_Twingle_Submission { @@ -503,7 +502,7 @@ class CRM_Twingle_Submission { // Try to find the TwingleProduct with its corresponding PriceField // for this product try { - $price_field = TwingleProduct::findByExternalId($product['id']); + $price_field = CRM_Twingle_BAO_TwingleProduct::findByExternalId($product['id']); } catch (Exception $e) { Civi::log()->error(E::LONG_NAME . diff --git a/api/v3/TwingleProduct/Create.php b/api/v3/TwingleProduct/Create.php index 36bb48a..2490557 100644 --- a/api/v3/TwingleProduct/Create.php +++ b/api/v3/TwingleProduct/Create.php @@ -2,7 +2,6 @@ use Civi\Twingle\Shop\Exceptions\ProductException; use CRM_Twingle_ExtensionUtil as E; -use Civi\Twingle\Shop\BAO\TwingleProduct; /** * TwingleProduct.Create API specification (optional) @@ -121,7 +120,7 @@ function civicrm_api3_twingle_product_Create($params): array { try { // Create TwingleProduct and load params - $product = new TwingleProduct(); + $product = new CRM_Twingle_BAO_TwingleProduct(); $product->load($params); // Save TwingleProduct diff --git a/api/v3/TwingleProduct/Delete.php b/api/v3/TwingleProduct/Delete.php index 60c9591..7c675ab 100644 --- a/api/v3/TwingleProduct/Delete.php +++ b/api/v3/TwingleProduct/Delete.php @@ -1,7 +1,6 @@ delete(); diff --git a/api/v3/TwingleProduct/Get.php b/api/v3/TwingleProduct/Get.php index a7f64ca..9544678 100644 --- a/api/v3/TwingleProduct/Get.php +++ b/api/v3/TwingleProduct/Get.php @@ -1,7 +1,6 @@ getMessage(), [ diff --git a/api/v3/TwingleShop/Create.php b/api/v3/TwingleShop/Create.php index ebb34f4..ab858ff 100644 --- a/api/v3/TwingleShop/Create.php +++ b/api/v3/TwingleShop/Create.php @@ -1,6 +1,5 @@ load($params); // Save TwingleShop diff --git a/api/v3/TwingleShop/Delete.php b/api/v3/TwingleShop/Delete.php index d1f3323..cc851a7 100644 --- a/api/v3/TwingleShop/Delete.php +++ b/api/v3/TwingleShop/Delete.php @@ -1,6 +1,6 @@ deleteByConstraint(); if ($result) { return civicrm_api3_create_success(1, $params, 'TwingleShop', 'Delete'); diff --git a/api/v3/TwingleShop/Fetch.php b/api/v3/TwingleShop/Fetch.php index 961f42b..9c5d3e3 100644 --- a/api/v3/TwingleShop/Fetch.php +++ b/api/v3/TwingleShop/Fetch.php @@ -1,7 +1,6 @@ fetchProducts(); $returnValues[$projectId] = []; $returnValues[$projectId] += $shop->getAttributes(); @@ -63,7 +62,7 @@ function civicrm_api3_twingle_shop_Fetch($params) { return $product->getAttributes(); }, $products); } - catch (ShopException|ApiCallError|ProductException $e) { + catch (ShopException | ApiCallError | ProductException $e) { // If this project identifier doesn't belong to a project of type // 'shop', just skip it if ($e->getErrorCode() == ShopException::ERROR_CODE_NOT_A_SHOP) { diff --git a/api/v3/TwingleShop/Get.php b/api/v3/TwingleShop/Get.php index 2915212..9309e04 100644 --- a/api/v3/TwingleShop/Get.php +++ b/api/v3/TwingleShop/Get.php @@ -1,6 +1,6 @@ getMessage(), [ diff --git a/info.xml b/info.xml index c019d80..edfa3fb 100644 --- a/info.xml +++ b/info.xml @@ -15,7 +15,7 @@ http://www.gnu.org/licenses/agpl-3.0.html - 1.5-dev + 1.6-dev dev 5.58 diff --git a/twingle.php b/twingle.php index c00ac35..9c20db1 100644 --- a/twingle.php +++ b/twingle.php @@ -17,7 +17,7 @@ function twingle_civicrm_pre($op, $objectName, $id, &$params) { // Create/delete PriceField and PriceFieldValue for TwingleProduct elseif ($objectName == 'TwingleProduct') { - $twingle_product = new \Civi\Twingle\Shop\BAO\TwingleProduct(); + $twingle_product = new CRM_Twingle_BAO_TwingleProduct(); $twingle_product->load($params); if ($op == 'create' || $op == 'edit') { $twingle_product->createPriceField(); @@ -30,7 +30,7 @@ function twingle_civicrm_pre($op, $objectName, $id, &$params) { // Create PriceSet for TwingleShop elseif ($objectName == 'TwingleShop' && ($op == 'create' || $op == 'edit')) { - $twingle_shop = new \Civi\Twingle\Shop\BAO\TwingleShop(); + $twingle_shop = new CRM_Twingle_BAO_TwingleShop(); $twingle_shop->load($params); $twingle_shop->createPriceSet(); $params = $twingle_shop->getAttributes();