for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @copyright Copyright (c) Flipbox Digital Limited
* @license https://flipboxfactory.com/software/hubspot/license
* @link https://www.flipboxfactory.com/software/hubspot/
*/
namespace flipbox\hubspot\criteria;
use craft\helpers\StringHelper;
use yii\base\BaseObject;
* @author Flipbox Factory <[email protected]>
* @since 1.0.0
class TimelineEventMutator extends BaseObject implements TimelineEventMutatorInterface
{
use traits\TransformerCollectionTrait,
traits\ConnectionTrait,
traits\CacheTrait;
* @var string
public $id;
* @var string|array
public $object;
* The event type Id
*
public $typeId;
* @var array
public $extraData = [];
* @var array|null
public $payload;
public $properties = [];
public $timelineIFrame = [];
* @return string
public function getTypeId(): string
return $this->typeId;
}
public function getId(): string
return (string)($this->id ?: StringHelper::randomString());
* @return array
public function getPayload(): array
// Explicitly set ?
if ($this->payload !== null) {
return (array)$this->payload;
$payload = array_merge(
$this->getObjectPayload(),
[
'timelineIFrame' => $this->timelineIFrame,
'extraData' => $this->extraData
],
$this->properties
);
return array_filter($payload);
protected function getObjectPayload(): array
if (is_numeric($this->object)) {
$this->object = ['objectId' => $this->object];
return (array)$this->object;