public function setStatus($status) { $status = strtolower($status); if (in_array($status, $this->statuses) === false) { throw new NotAllowedTypeException(['type' => $status, 'to' => 'Status']); } $this->setAttribute('status', $status); }