mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
activity: avoid adding persons|Users|Thirdparty if not allowed
This commit is contained in:
@@ -22,6 +22,7 @@ use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
use Symfony\Component\Serializer\Annotation\Groups;
|
||||
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
|
||||
use Symfony\Component\Serializer\Annotation\SerializedName;
|
||||
|
||||
/**
|
||||
* Class Activity
|
||||
@@ -30,7 +31,7 @@ use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
|
||||
* @ORM\Entity(repositoryClass="Chill\ActivityBundle\Repository\ActivityRepository")
|
||||
* @ORM\Table(name="activity")
|
||||
* @ORM\HasLifecycleCallbacks()
|
||||
* @DiscriminatorMap(typeProperty="type", mapping={
|
||||
* @DiscriminatorMap(typeProperty="_type", mapping={
|
||||
* "activity"=Activity::class
|
||||
* })
|
||||
*/
|
||||
@@ -102,6 +103,8 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityType")
|
||||
* @Groups({"read"})
|
||||
* @SerializedName("activityType")
|
||||
*/
|
||||
private ActivityType $type;
|
||||
|
||||
|
@@ -21,6 +21,7 @@
|
||||
namespace Chill\ActivityBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation\Groups;
|
||||
|
||||
/**
|
||||
* Class ActivityType
|
||||
@@ -45,11 +46,13 @@ class ActivityType
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="json")
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
private array $name = [];
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
private bool $active = true;
|
||||
|
||||
@@ -100,6 +103,7 @@ class ActivityType
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="smallint", nullable=false, options={"default"=1})
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
private int $personsVisible = self::FIELD_OPTIONAL;
|
||||
|
||||
@@ -110,6 +114,7 @@ class ActivityType
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="smallint", nullable=false, options={"default"=1})
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
private int $thirdPartiesVisible = self::FIELD_INVISIBLE;
|
||||
|
||||
@@ -190,6 +195,7 @@ class ActivityType
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="smallint", nullable=false, options={"default"=1})
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
private int $usersVisible = self::FIELD_OPTIONAL;
|
||||
|
||||
|
Reference in New Issue
Block a user