created = $created; return $this; } /** * @return \DateTime */ public function getCreated() { return $this->created; } /** * @return integer */ public function getId() { return $this->id; } /** * @param array $data * * @return WebhookEvent */ public function setData(array $data) { $this->data = $data; return $this; } /** * @return array */ public function getData() { return $this->data; } /** * @param $name * * @return WebhookEvent * @throws \InvalidArgumentException */ public function setName($name) { if (!in_array($name, self::events())) { throw new \InvalidArgumentException("Invalid event name"); } $this->name = $name; return $this; } /** * @return string */ public function getName() { return $this->name; } /** * @param boolean $processed * * @return $this */ public function setProcessed($processed) { $this->processed = (Boolean) $processed; return $this; } /** * @return boolean */ public function isProcessed() { return $this->processed; } /** * @return string */ public function getType() { return $this->type; } /** * @param $type * * @return $this * @throws \InvalidArgumentException */ public function setType($type) { if (!in_array($type, self::types())) { throw new \InvalidArgumentException("Invalid event name"); } $this->type = $type; return $this; } }