for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Glorand\Drip\Models;
use DateTime;
use Glorand\Drip\Models\Traits\Jsonable;
use JsonSerializable;
class Event implements JsonSerializable
{
use Jsonable;
/**
* @var array
*/
protected $properties;
* @var string
protected $email;
protected $action;
* @var DateTime
protected $occurred_at;
* @param string $key
* @param string $value
*
* @return Event
public function addProperty(string $key, string $value): self
$this->properties[$key] = $value;
return $this;
}
public function removeProperty(string $key): self
if (!empty($this->properties[$key])) {
unset($this->properties[$key]);
* @param array $properties
public function setProperties(array $properties): self
$this->properties = $properties;
* @param string $email
public function setEmail(string $email): self
$this->email = $email;
* @param string $action
public function setAction(string $action): self
$this->action = $action;
* @param DateTime $occurredAt
public function setOccurredAt(DateTime $occurredAt): self
$this->occurred_at = $occurredAt;
public function toDrip(): array
return [
"events" => [
$this->jsonSerialize(),
],
];