diff --git a/lib/neues_author.php b/lib/neues_author.php index 230b008..a9fe12b 100644 --- a/lib/neues_author.php +++ b/lib/neues_author.php @@ -1,6 +1,6 @@ getValue("name"); + return $this->getValue('name'); } /** @@ -47,9 +47,9 @@ public function getName() : ?string * * @api */ - public function setName(string $value) : self + public function setName(string $value): self { - $this->setValue("name", $value); + $this->setValue('name', $value); return $this; } @@ -65,9 +65,9 @@ public function setName(string $value) : self * * @api */ - public function getNickname() : ?string + public function getNickname(): ?string { - return $this->getValue("nickname"); + return $this->getValue('nickname'); } /** @@ -82,9 +82,9 @@ public function getNickname() : ?string * * @api */ - public function setNickname(string $value) : self + public function setNickname(string $value): self { - $this->setValue("nickname", $value); + $this->setValue('nickname', $value); return $this; } @@ -101,14 +101,14 @@ public function setNickname(string $value) : self * * @api */ - public function getText(bool $asPlaintext = false) : ?string + public function getText(bool $asPlaintext = false): ?string { - if($asPlaintext) { - return strip_tags($this->getValue("text")); + if ($asPlaintext) { + return strip_tags($this->getValue('text')); } - return $this->getValue("text"); + return $this->getValue('text'); } - + /** * Setzt den Text des Autors. * Sets the text of the author. @@ -121,9 +121,9 @@ public function getText(bool $asPlaintext = false) : ?string * * @api */ - public function setText(string $value) : self + public function setText(string $value): self { - $this->setValue("text", $value); + $this->setValue('text', $value); return $this; } @@ -139,9 +139,9 @@ public function setText(string $value) : self * * @api */ - public function getBeUserId() : ?int + public function getBeUserId(): ?int { - return $this->getValue("be_user_id"); + return $this->getValue('be_user_id'); } /** @@ -156,9 +156,9 @@ public function getBeUserId() : ?int * * @api */ - public function setBeUserId(int $value) : self + public function setBeUserId(int $value): self { - $this->setValue("be_user_id", $value); + $this->setValue('be_user_id', $value); return $this; } @@ -171,7 +171,7 @@ public function setBeUserId(int $value) : self * Beispiel / Example: * $beUser = $author->getBeUser(); */ - public function getBeUser() : ?rex_user + public function getBeUser(): ?rex_user { return rex_user::get($this->getBeUserId()); } diff --git a/lib/neues_category.php b/lib/neues_category.php index 6c69743..18ab805 100644 --- a/lib/neues_category.php +++ b/lib/neues_category.php @@ -1,6 +1,6 @@ getValue('name'); } + /** * Setzt den Namen der Kategorie. * Sets the name of the category. @@ -45,6 +46,7 @@ public function setName(string $name): self $this->setValue('name', $name); return $this; } + /** * Gibt die Einträge der Kategorie zurück. * Returns the entries of the category. @@ -60,6 +62,7 @@ public function getEntries(): ?rex_yform_manager_collection { return $this->getRelatedDataset('entry_ids'); } + /** * Gibt die URL der Kategorie zurück. * Returns the URL of the category. diff --git a/lib/neues_entry.php b/lib/neues_entry.php index 7539fcf..3207f51 100644 --- a/lib/neues_entry.php +++ b/lib/neues_entry.php @@ -1,6 +1,6 @@ setValue('name', $name); return $this; } + /** * @api * @return string @@ -52,6 +53,7 @@ public function setAuthor(string $author): self $this->setValue('author', $author); return $this; } + /** * @api * @return string @@ -117,7 +119,7 @@ public function setImages(?array $images): self /** @api */ public function getMedia(): ?rex_media { - if(rex_addon::get('media_manager_resposnive')->isAvailable()) { + if (rex_addon::get('media_manager_resposnive')->isAvailable()) { return rex_media_plus::get($this->getImage()); } return rex_media::get($this->getImage()); @@ -216,15 +218,15 @@ public function setStatus(int $status): self return $this; } - public static function findOnline(int $category_id = null): ?rex_yform_manager_collection + public static function findOnline(?int $category_id = null): ?rex_yform_manager_collection { - if($category_id) { + if ($category_id) { return self::findByCategory($category_id); } return self::query()->where('status', 1, '>=')->find(); } - public static function findByCategory(int $category_id = null, int $status = 1): ?rex_yform_manager_collection + public static function findByCategory(?int $category_id = null, int $status = 1): ?rex_yform_manager_collection { $query = self::query()->joinRelation('category_ids', 'c')->where('rex_neues_entry.status', $status, '>=')->where('c.id', $category_id); return $query->find();