mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Merge branch 'master' into user_absences
This commit is contained in:
95
src/Bundle/ChillMainBundle/Entity/Regroupment.php
Normal file
95
src/Bundle/ChillMainBundle/Entity/Regroupment.php
Normal file
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Chill\MainBundle\Entity;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
* @ORM\Table(name="regroupment")
|
||||
*/
|
||||
class Regroupment
|
||||
{
|
||||
/**
|
||||
* @var Center
|
||||
* @ORM\ManyToMany(
|
||||
* targetEntity="Chill\MainBundle\Entity\Center"
|
||||
* )
|
||||
* @ORM\Id
|
||||
*/
|
||||
private Collection $centers;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
private bool $isActive = true;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=15, options={"default": ""}, nullable=false)
|
||||
*/
|
||||
private string $name = '';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->centers = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getCenters(): ?Collection
|
||||
{
|
||||
return $this->centers;
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getIsActive(): bool
|
||||
{
|
||||
return $this->isActive;
|
||||
}
|
||||
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setCenters(?Collection $centers): self
|
||||
{
|
||||
$this->centers = $centers;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setIsActive(bool $isActive): self
|
||||
{
|
||||
$this->isActive = $isActive;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setName(string $name): self
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
@@ -16,7 +16,7 @@ use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use RuntimeException;
|
||||
use Symfony\Component\Security\Core\User\AdvancedUserInterface;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
@@ -32,7 +32,7 @@ use function in_array;
|
||||
* "user": User::class
|
||||
* })
|
||||
*/
|
||||
class User implements AdvancedUserInterface
|
||||
class User implements UserInterface
|
||||
{
|
||||
/**
|
||||
* @ORM\Id
|
||||
@@ -64,8 +64,6 @@ class User implements AdvancedUserInterface
|
||||
private ?Location $currentLocation = null;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(type="string", length=150, nullable=true)
|
||||
*/
|
||||
private ?string $email = null;
|
||||
@@ -227,7 +225,7 @@ class User implements AdvancedUserInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @return GroupCenter
|
||||
* @return Collection<GroupCenter>
|
||||
*/
|
||||
public function getGroupCenters()
|
||||
{
|
||||
@@ -236,10 +234,8 @@ class User implements AdvancedUserInterface
|
||||
|
||||
/**
|
||||
* Get id.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getId()
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
@@ -508,7 +504,7 @@ class User implements AdvancedUserInterface
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return Agent
|
||||
* @return User
|
||||
*/
|
||||
public function setUsername($name)
|
||||
{
|
||||
|
@@ -132,8 +132,6 @@ class EntityWorkflowStep
|
||||
{
|
||||
if (!$this->destUser->contains($user)) {
|
||||
$this->destUser[] = $user;
|
||||
$this->getEntityWorkflow()
|
||||
->addSubscriberToFinal($user);
|
||||
}
|
||||
|
||||
return $this;
|
||||
@@ -143,8 +141,6 @@ class EntityWorkflowStep
|
||||
{
|
||||
if (!$this->destUserByAccessKey->contains($user) && !$this->destUser->contains($user)) {
|
||||
$this->destUserByAccessKey[] = $user;
|
||||
$this->getEntityWorkflow()
|
||||
->addSubscriberToFinal($user);
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
Reference in New Issue
Block a user