mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 05:47:11 +02:00
Implemented has slug and id method
This commit is contained in:
@@ -21,4 +21,9 @@ trait IdAttribut
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function hasId(): bool
|
||||
{
|
||||
return isset($this->id);
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user