diff options
Diffstat (limited to 'www/crm/wp-content/plugins/civicrm/civicrm/ext/api4/Civi/Api4/Action/CustomValue')
7 files changed, 100 insertions, 0 deletions
diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/ext/api4/Civi/Api4/Action/CustomValue/Create.php b/www/crm/wp-content/plugins/civicrm/civicrm/ext/api4/Civi/Api4/Action/CustomValue/Create.php new file mode 100644 index 00000000..7d059b24 --- /dev/null +++ b/www/crm/wp-content/plugins/civicrm/civicrm/ext/api4/Civi/Api4/Action/CustomValue/Create.php @@ -0,0 +1,11 @@ +<?php + +namespace Civi\Api4\Action\CustomValue; + +/** + * @inheritDoc + */ +class Create extends \Civi\Api4\Generic\DAOCreateAction { + use \Civi\Api4\Generic\Traits\CustomValueActionTrait; + +} diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/ext/api4/Civi/Api4/Action/CustomValue/Delete.php b/www/crm/wp-content/plugins/civicrm/civicrm/ext/api4/Civi/Api4/Action/CustomValue/Delete.php new file mode 100644 index 00000000..7c521748 --- /dev/null +++ b/www/crm/wp-content/plugins/civicrm/civicrm/ext/api4/Civi/Api4/Action/CustomValue/Delete.php @@ -0,0 +1,11 @@ +<?php + +namespace Civi\Api4\Action\CustomValue; + +/** + * Delete one or more items, based on criteria specified in Where param. + */ +class Delete extends \Civi\Api4\Generic\DAODeleteAction { + use \Civi\Api4\Generic\Traits\CustomValueActionTrait; + +} diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/ext/api4/Civi/Api4/Action/CustomValue/Get.php b/www/crm/wp-content/plugins/civicrm/civicrm/ext/api4/Civi/Api4/Action/CustomValue/Get.php new file mode 100644 index 00000000..47f3f514 --- /dev/null +++ b/www/crm/wp-content/plugins/civicrm/civicrm/ext/api4/Civi/Api4/Action/CustomValue/Get.php @@ -0,0 +1,11 @@ +<?php + +namespace Civi\Api4\Action\CustomValue; + +/** + * Get fields for a custom group. + */ +class Get extends \Civi\Api4\Generic\DAOGetAction { + use \Civi\Api4\Generic\Traits\CustomValueActionTrait; + +} diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/ext/api4/Civi/Api4/Action/CustomValue/GetActions.php b/www/crm/wp-content/plugins/civicrm/civicrm/ext/api4/Civi/Api4/Action/CustomValue/GetActions.php new file mode 100644 index 00000000..8af9088d --- /dev/null +++ b/www/crm/wp-content/plugins/civicrm/civicrm/ext/api4/Civi/Api4/Action/CustomValue/GetActions.php @@ -0,0 +1,11 @@ +<?php + +namespace Civi\Api4\Action\CustomValue; + +/** + * @inheritDoc + */ +class GetActions extends \Civi\Api4\Action\GetActions { + use \Civi\Api4\Generic\Traits\CustomValueActionTrait; + +} diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/ext/api4/Civi/Api4/Action/CustomValue/GetFields.php b/www/crm/wp-content/plugins/civicrm/civicrm/ext/api4/Civi/Api4/Action/CustomValue/GetFields.php new file mode 100644 index 00000000..733776b7 --- /dev/null +++ b/www/crm/wp-content/plugins/civicrm/civicrm/ext/api4/Civi/Api4/Action/CustomValue/GetFields.php @@ -0,0 +1,34 @@ +<?php + +namespace Civi\Api4\Action\CustomValue; + +use Civi\Api4\Service\Spec\SpecGatherer; +use Civi\Api4\Service\Spec\SpecFormatter; + +/** + * Get fields for a custom group. + */ +class GetFields extends \Civi\Api4\Generic\DAOGetFieldsAction { + use \Civi\Api4\Generic\Traits\CustomValueActionTrait; + + protected function getRecords() { + $fields = $this->_itemsToGet('name'); + /** @var SpecGatherer $gatherer */ + $gatherer = \Civi::container()->get('spec_gatherer'); + $spec = $gatherer->getSpec('Custom_' . $this->getCustomGroup(), $this->getAction(), $this->includeCustom); + return SpecFormatter::specToArray($spec->getFields($fields), (array) $this->select, $this->loadOptions); + } + + /** + * @inheritDoc + */ + public function getParamInfo($param = NULL) { + $info = parent::getParamInfo($param); + if (!$param) { + // This param is meaningless here. + unset($info['includeCustom']); + } + return $info; + } + +} diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/ext/api4/Civi/Api4/Action/CustomValue/Replace.php b/www/crm/wp-content/plugins/civicrm/civicrm/ext/api4/Civi/Api4/Action/CustomValue/Replace.php new file mode 100644 index 00000000..457be9ca --- /dev/null +++ b/www/crm/wp-content/plugins/civicrm/civicrm/ext/api4/Civi/Api4/Action/CustomValue/Replace.php @@ -0,0 +1,11 @@ +<?php + +namespace Civi\Api4\Action\CustomValue; + +/** + * Given a set of records, will appropriately update the database. + */ +class Replace extends \Civi\Api4\Generic\BasicReplaceAction { + use \Civi\Api4\Generic\Traits\CustomValueActionTrait; + +} diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/ext/api4/Civi/Api4/Action/CustomValue/Update.php b/www/crm/wp-content/plugins/civicrm/civicrm/ext/api4/Civi/Api4/Action/CustomValue/Update.php new file mode 100644 index 00000000..14f66f29 --- /dev/null +++ b/www/crm/wp-content/plugins/civicrm/civicrm/ext/api4/Civi/Api4/Action/CustomValue/Update.php @@ -0,0 +1,11 @@ +<?php + +namespace Civi\Api4\Action\CustomValue; + +/** + * Update one or more records with new values. Use the where clause to select them. + */ +class Update extends \Civi\Api4\Generic\DAOUpdateAction { + use \Civi\Api4\Generic\Traits\CustomValueActionTrait; + +} |