public function setPublished($published) { $published = strtolower($published); if (in_array($published, $this->publishes) === false) { throw new NotAllowedTypeException(['type' => $published, 'to' => 'Published']); } $this->setAttribute('published', $published); }