mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-06 21:39:42 +00:00
Feature: add property concernedUsersCount to the AsideActivity.php entity
This commit is contained in:
@@ -62,6 +62,10 @@ class AsideActivity implements TrackCreationInterface, TrackUpdateInterface
|
||||
#[ORM\ManyToOne(targetEntity: User::class)]
|
||||
private User $updatedBy;
|
||||
|
||||
#[Assert\GreaterThanOrEqual(0)]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER, nullable: true)]
|
||||
private ?int $concernedUsersCount = null;
|
||||
|
||||
public function getAgent(): ?User
|
||||
{
|
||||
return $this->agent;
|
||||
@@ -186,4 +190,16 @@ class AsideActivity implements TrackCreationInterface, TrackUpdateInterface
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getConcernedUsersCount(): ?int
|
||||
{
|
||||
return $this->concernedUsersCount;
|
||||
}
|
||||
|
||||
public function setConcernedUsersCount(?int $concernedUsersCount): self
|
||||
{
|
||||
$this->concernedUsersCount = $concernedUsersCount;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\Migrations\AsideActivity;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20251006113048 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Add concernedUsersCount property to AsideActivity entity';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_asideactivity.asideactivity ADD concernedUsersCount INT DEFAULT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_asideactivity.AsideActivity DROP concernedUsersCount');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user