diff --git a/application/symfony/src/Entity/Attribut/IdAttribut.php b/application/symfony/src/Entity/Attribut/IdAttribut.php index 7a90708..a2db666 100644 --- a/application/symfony/src/Entity/Attribut/IdAttribut.php +++ b/application/symfony/src/Entity/Attribut/IdAttribut.php @@ -21,4 +21,9 @@ trait IdAttribut { return $this->id; } + + public function hasId(): bool + { + return isset($this->id); + } } diff --git a/application/symfony/src/Entity/Attribut/IdAttributInterface.php b/application/symfony/src/Entity/Attribut/IdAttributInterface.php index 6af8838..63ee1de 100644 --- a/application/symfony/src/Entity/Attribut/IdAttributInterface.php +++ b/application/symfony/src/Entity/Attribut/IdAttributInterface.php @@ -7,7 +7,18 @@ namespace App\Entity\Attribut; */ interface IdAttributInterface { + /** + * @param int $id + */ public function setId(int $id): void; + /** + * @return int + */ public function getId(): int; + + /** + * @return bool Checks if attribute is set + */ + public function hasId(): bool; } diff --git a/application/symfony/src/Entity/Attribut/SlugAttribut.php b/application/symfony/src/Entity/Attribut/SlugAttribut.php index c38d198..73dc5fb 100644 --- a/application/symfony/src/Entity/Attribut/SlugAttribut.php +++ b/application/symfony/src/Entity/Attribut/SlugAttribut.php @@ -2,6 +2,9 @@ namespace App\Entity\Attribut; +/** + * @author kevinfrantz + */ trait SlugAttribut { /** @@ -18,4 +21,9 @@ trait SlugAttribut { return $this->slug; } + + public function hasSlug(): bool + { + return isset($this->slug); + } } diff --git a/application/symfony/src/Entity/Attribut/SlugAttributInterface.php b/application/symfony/src/Entity/Attribut/SlugAttributInterface.php index d106d87..6b09f31 100644 --- a/application/symfony/src/Entity/Attribut/SlugAttributInterface.php +++ b/application/symfony/src/Entity/Attribut/SlugAttributInterface.php @@ -2,9 +2,23 @@ namespace App\Entity\Attribut; +/** + * @author kevinfrantz + */ interface SlugAttributInterface { + /** + * @param string $slug + */ public function setSlug(string $slug): void; + /** + * @return string + */ public function getSlug(): string; + + /** + * @return bool Checks if a slug is set + */ + public function hasSlug(): bool; }