diff --git a/src/Entity/ProjectEntity.php b/src/Entity/ProjectEntity.php new file mode 100644 index 0000000..2cd388e --- /dev/null +++ b/src/Entity/ProjectEntity.php @@ -0,0 +1,105 @@ +id; + } + + /** + * Set the ID of the entity + *
This should not be done after creation + * + * @param string $id + * @return self + */ + public function setId(string $id): self + { + $this->id = $id; + + return $this; + } + + /** + * Generate and save a random ID + * + * @return string Generated ID + */ + public function generateId(): string + { + // Generate ID + $id = StringGenerationHelper::generateString(array_merge(range('a', 'z'), range('A', 'Z'), range('0', '9')), 8); + + // Save and return + $this->setId($id); + return $id; + } + + /** + * Get the name of the project + * + * @return string + */ + public function getName(): string + { + return $this->name; + } + + /** + * Get the name of the project + * + * @param string $name + * @return self + */ + public function setName(string $name): self + { + $this->name = $name; + + return $this; + } + + /** + * If the project is active + * + * @return bool + */ + public function getActive(): bool + { + return $this->active; + } + + /** + * Set the active status of the project + * + * @param bool $active + * @return self + */ + public function setActive(bool $active): self + { + $this->active = $active; + + return $this; + } +} \ No newline at end of file