code: public function jsonSerialize()
      {
          return [
              'ip_address' => $this->getIpAddress(),
              'action'  => $this->getAction(),
              'campaign_id' => (int)$this->getCampaignId(),
              'list_external_id' => $this->getListExternalId(),
              'reason' => $this->getReason(),
              'recipient_email_address' => $this->getRecipientEmailAddress(),
              'hash' => $this->getHash(),
              'recipient_external_id' => (string)$this->getRecipientExternalId(),
              'trigger_date' => $this->getTriggerDate()->format('Y-m-d h:i:s'),
              'type' => $this->getType()
          ];
      }
docs: (PHP 5 &gt;= 5.4.0)<br/>
  Specify data which should be serialized to JSON
  @link http://php.net/manual/en/jsonserializable.jsonserialize.php
  @return mixed data which can be serialized by <b>json_encode</b>,
  which is a value of any type other than a resource.