feat(backend) : add archived field to TaskGroup entity
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace App\Entity;
|
namespace App\Entity;
|
||||||
|
|
||||||
|
use ApiPlatform\Doctrine\Orm\Filter\BooleanFilter;
|
||||||
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
|
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
|
||||||
use ApiPlatform\Metadata\ApiFilter;
|
use ApiPlatform\Metadata\ApiFilter;
|
||||||
use ApiPlatform\Metadata\ApiResource;
|
use ApiPlatform\Metadata\ApiResource;
|
||||||
@@ -29,6 +30,7 @@ use Symfony\Component\Serializer\Attribute\Groups;
|
|||||||
order: ['title' => 'ASC'],
|
order: ['title' => 'ASC'],
|
||||||
)]
|
)]
|
||||||
#[ApiFilter(SearchFilter::class, properties: ['project' => 'exact'])]
|
#[ApiFilter(SearchFilter::class, properties: ['project' => 'exact'])]
|
||||||
|
#[ApiFilter(BooleanFilter::class, properties: ['archived'])]
|
||||||
#[ORM\Entity(repositoryClass: TaskGroupRepository::class)]
|
#[ORM\Entity(repositoryClass: TaskGroupRepository::class)]
|
||||||
class TaskGroup
|
class TaskGroup
|
||||||
{
|
{
|
||||||
@@ -55,6 +57,10 @@ class TaskGroup
|
|||||||
#[Groups(['task_group:read', 'task_group:write'])]
|
#[Groups(['task_group:read', 'task_group:write'])]
|
||||||
private ?Project $project = null;
|
private ?Project $project = null;
|
||||||
|
|
||||||
|
#[ORM\Column(type: 'boolean')]
|
||||||
|
#[Groups(['task_group:read', 'task_group:write', 'task:read'])]
|
||||||
|
private bool $archived = false;
|
||||||
|
|
||||||
public function getId(): ?int
|
public function getId(): ?int
|
||||||
{
|
{
|
||||||
return $this->id;
|
return $this->id;
|
||||||
@@ -107,4 +113,16 @@ class TaskGroup
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isArchived(): bool
|
||||||
|
{
|
||||||
|
return $this->archived;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setArchived(bool $archived): static
|
||||||
|
{
|
||||||
|
$this->archived = $archived;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user