mediaGroup = MediaGroup::create(MediaGroupType::fromString('image')); $this->category = new ArrayCollection(); } /** * @return int */ public function getId(): int { return $this->id; } public function getCreatorUserId(): int { return $this->creatorUserId; } public function getEditorUserId(): int { return $this->editorUserId; } /** * @return bool */ public function isActive(): bool { return $this->active; } /** * @param bool $active */ public function setActive(bool $active): void { $this->active = $active; } /** * @return Collection $category */ public function getCategory() { return $this->category; } public function setCategory(Collection $category) { $this->category = $category; } /** * @return bool */ public function isOnMain(): bool { return $this->onMain; } /** * @param bool $onMain */ public function setOnMain(bool $onMain): void { $this->onMain = $onMain; } /** * @return string */ public function getTitle() { return (string)$this->title; } /** * @param string $title */ public function setTitle(string $title): void { $this->title = $title; } /** * @return string */ public function getDescription() { return (string)$this->description; } /** * @param string $description */ public function setDescription(string $description): void { $this->description = $description; } /** * @return string */ public function getText() { return (string)$this->text; } /** * @return Meta */ public function getMeta() { return $this->meta; } /** * @param Meta $meta */ public function setMeta(Meta $meta): void { $this->meta = $meta; } /** * @return string */ public function getImage(): string { return $this->image; } /** * @param string $image */ //public function setImage(string $image): void public function setImage($image): void { if(!$image){ $image = ''; } $this->image = $image; } /** * @return MediaGroup */ public function getMediaGroup() { return $this->mediaGroup; } /** * @param MediaGroup $mediaGroup */ public function setMediaGroup(MediaGroup $mediaGroup): void { $this->mediaGroup = $mediaGroup; } /** * @param string $text */ public function setText( $text): void { $this->text = $text; } /** * @ORM\PrePersist */ public function prePersist() { // $this->createdOn = $this->editedOn = new DateTime(); $this->creatorUserId = $this->editorUserId = Authentication::getUser()->getUserId(); } }