From f63756b0dff7269a33ba7ef78390630438c7a37b Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sat, 18 Jan 2020 13:46:29 -0500 Subject: [PATCH] Add code docs to Api4/CustomValue --- Civi/Api4/CustomValue.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Civi/Api4/CustomValue.php b/Civi/Api4/CustomValue.php index 2860ea5cda..764c8e49a4 100644 --- a/Civi/Api4/CustomValue.php +++ b/Civi/Api4/CustomValue.php @@ -22,7 +22,15 @@ namespace Civi\Api4; /** - * CustomGroup entity. + * Provides virtual api entities for every multi-record custom group. + * + * This class is different from other apis in that it is not itself an entity, but allows every + * multi-record custom group to act like an entity. + * + * Each action takes the name of the custom group as a parameter, or in traditional syntax the entity is prefixed with 'Custom_' + * + * Ex. OOP: \Civi\Api4\CustomValue::get('MyStuff')->addWhere('id', '=', 123) + * Non-OOP: civicrm_api4('Custom_MyStuff', 'get', ['where' => [['id', '=', 123]]]); * * @package Civi\Api4 */ @@ -31,6 +39,7 @@ class CustomValue extends Generic\AbstractEntity { /** * @param string $customGroup * @return Action\CustomValue\Get + * @throws \API_Exception */ public static function get($customGroup) { return new Action\CustomValue\Get($customGroup, __FUNCTION__); @@ -39,6 +48,7 @@ class CustomValue extends Generic\AbstractEntity { /** * @param string $customGroup * @return Action\CustomValue\GetFields + * @throws \API_Exception */ public static function getFields($customGroup = NULL) { return new Action\CustomValue\GetFields($customGroup, __FUNCTION__); @@ -47,6 +57,7 @@ class CustomValue extends Generic\AbstractEntity { /** * @param string $customGroup * @return Action\CustomValue\Save + * @throws \API_Exception */ public static function save($customGroup) { return new Action\CustomValue\Save($customGroup, __FUNCTION__); @@ -55,6 +66,7 @@ class CustomValue extends Generic\AbstractEntity { /** * @param string $customGroup * @return Action\CustomValue\Create + * @throws \API_Exception */ public static function create($customGroup) { return new Action\CustomValue\Create($customGroup, __FUNCTION__); @@ -63,6 +75,7 @@ class CustomValue extends Generic\AbstractEntity { /** * @param string $customGroup * @return Action\CustomValue\Update + * @throws \API_Exception */ public static function update($customGroup) { return new Action\CustomValue\Update($customGroup, __FUNCTION__); @@ -71,6 +84,7 @@ class CustomValue extends Generic\AbstractEntity { /** * @param string $customGroup * @return Action\CustomValue\Delete + * @throws \API_Exception */ public static function delete($customGroup) { return new Action\CustomValue\Delete($customGroup, __FUNCTION__); @@ -79,6 +93,7 @@ class CustomValue extends Generic\AbstractEntity { /** * @param string $customGroup * @return Action\CustomValue\Replace + * @throws \API_Exception */ public static function replace($customGroup) { return new Action\CustomValue\Replace($customGroup, __FUNCTION__); @@ -87,6 +102,7 @@ class CustomValue extends Generic\AbstractEntity { /** * @param string $customGroup * @return Action\CustomValue\GetActions + * @throws \API_Exception */ public static function getActions($customGroup = NULL) { return new Action\CustomValue\GetActions($customGroup, __FUNCTION__); -- 2.25.1