Merge pull request #18281 from sunilpawar/report_48
[civicrm-core.git] / Civi / Api4 / Generic / BasicBatchAction.php
index 259b68cbe87a97da93942465eb9a9be9bbcc230c..d1787bd44a127ca9ee3208c571a9cdfccbd28596 100644 (file)
@@ -14,8 +14,6 @@
  *
  * @package CRM
  * @copyright CiviCRM LLC https://civicrm.org/licensing
- * $Id$
- *
  */
 
 
@@ -24,12 +22,9 @@ namespace Civi\Api4\Generic;
 use Civi\API\Exception\NotImplementedException;
 
 /**
- * Basic action for deleting or performing some other task with a set of records.  Ex:
+ * $ACTION one or more $ENTITIES.
  *
- * $myAction = new BasicBatchAction('Entity', 'action', function($item) {
- *   // Do something with $item
- *   $return $item;
- * });
+ * $ENTITIES are selected based on criteria specified in `where` parameter (required).
  *
  * @package Civi\Api4\Generic
  */
@@ -37,20 +32,25 @@ class BasicBatchAction extends AbstractBatchAction {
 
   /**
    * @var callable
-   *
-   * Function(array $item, BasicBatchAction $thisAction) => array
+   *   Function(array $item, BasicBatchAction $thisAction): array
    */
   private $doer;
 
   /**
    * BasicBatchAction constructor.
    *
+   * ```php
+   * $myAction = new BasicBatchAction($entityName, $actionName, function($item) {
+   *   // Do something with $item
+   *   $return $item;
+   * });
+   * ```
+   *
    * @param string $entityName
    * @param string $actionName
    * @param string|array $select
    *   One or more fields to select from each matching item.
    * @param callable $doer
-   *   Function(array $item, BasicBatchAction $thisAction) => array
    */
   public function __construct($entityName, $actionName, $select = 'id', $doer = NULL) {
     parent::__construct($entityName, $actionName, $select);