Merge pull request #19095 from nishant-bhorodia/Issue#537-owner-notification-email...
[civicrm-core.git] / Civi / Api4 / Action / GroupContact / GroupContactSaveTrait.php
1 <?php
2
3 /*
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC. All rights reserved. |
6 | |
7 | This work is published under the GNU AGPLv3 license with some |
8 | permitted exceptions and without any warranty. For full license |
9 | and copyright information, see https://civicrm.org/licensing |
10 +--------------------------------------------------------------------+
11 */
12
13 /**
14 *
15 * @package CRM
16 * @copyright CiviCRM LLC https://civicrm.org/licensing
17 */
18
19
20 namespace Civi\Api4\Action\GroupContact;
21
22 /**
23 * @inheritDoc
24 *
25 * @method $this setMethod(string $method) Indicate who added/removed the group.
26 * @method string getMethod()
27 * @method $this setTracking(string $tracking) Specify ip address or other tracking info.
28 * @method string getTracking()
29 */
30 trait GroupContactSaveTrait {
31
32 /**
33 * String to indicate who added/removed the group.
34 *
35 * @var string
36 */
37 protected $method = 'API';
38
39 /**
40 * IP address or other tracking info about who performed this group subscription.
41 *
42 * @var string
43 */
44 protected $tracking = '';
45
46 /**
47 * @inheritDoc
48 */
49 protected function writeObjects($items) {
50 foreach ($items as &$item) {
51 $item['method'] = $this->method;
52 $item['tracking'] = $this->tracking;
53 }
54 return parent::writeObjects($items);
55 }
56
57 }