714225982806e623e988026ea75eddaa8ad7dac4
[civicrm-core.git] / Civi / Api4 / Action / GroupContact / GroupContactSaveTrait.php
1 <?php
2
3 namespace Civi\Api4\Action\GroupContact;
4
5 /**
6 * @inheritDoc
7 *
8 * @method $this setMethod(string $method) Indicate who added/removed the group.
9 * @method string getMethod()
10 * @method $this setTracking(string $tracking) Specify ip address or other tracking info.
11 * @method string getTracking()
12 */
13 trait GroupContactSaveTrait {
14
15 /**
16 * String to indicate who added/removed the group.
17 *
18 * @var string
19 */
20 protected $method = 'API';
21
22 /**
23 * IP address or other tracking info about who performed this group subscription.
24 *
25 * @var string
26 */
27 protected $tracking = '';
28
29 /**
30 * @inheritDoc
31 */
32 protected function writeObjects($items) {
33 foreach ($items as &$item) {
34 $item['method'] = $this->method;
35 $item['tracking'] = $this->tracking;
36 }
37 return parent::writeObjects($items);
38 }
39
40 }