| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- <?php
- namespace AppBundle\Entity\Person;
- use AppBundle\Entity\AccessAndFunction\Access;
- use AppBundle\Entity\Traits\ActivityPeriodTrait;
- use Doctrine\ORM\Mapping as ORM;
- use Dunglas\ApiBundle\Annotation\Iri;
- use Symfony\Component\Serializer\Annotation\Groups;
- use Symfony\Component\Validator\Constraints as Assert;
- use AppBundle\Entity\Traits\TimestampableEntity;
- use AppBundle\Entity\Traits\CreatorUpdaterEntity;
- /**
- * Rôle d'un Access d'une personne physique dans un Access d'une personne morale
- *
- * @Iri("http://schema.org/CompanyPerson")
- */
- #[ORM\Entity]
- class CompanyPerson
- {
- use TimestampableEntity;
- use CreatorUpdaterEntity;
- use ActivityPeriodTrait;
- /**
- * @var int
- */
- #[ORM\Column(type: 'integer')]
- #[ORM\Id]
- #[ORM\GeneratedValue(strategy: 'AUTO')]
- #[Groups(['othercontact_list', 'othercontact_list_companypersoncompany', 'companyperson', 'access_details', 'morals_list'])]
- private $id;
- /**
- * @var Access
- */
- #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access', inversedBy: 'companyPersonAccesses')]
- #[ORM\JoinColumn(nullable: false)]
- #[Assert\NotNull]
- #[Groups(['companyperson', 'othercontact_list_companypersoncompany', 'access_details_companypersonaccesses', 'access_details_companypersoncompany'])]
- private $company;
- /**
- * @var Access
- */
- #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access', inversedBy: 'companyPersonCompany')]
- #[ORM\JoinColumn(nullable: false)]
- #[Assert\NotNull]
- #[Groups(['companyperson', 'access_details_companypersonaccesses', 'morals_list_companypersonaccesses'])]
- private $access;
- /**
- * @var string
- */
- #[ORM\Column(type: 'text', nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Groups(['companyperson', 'othercontact_list_companypersoncompany', 'access_details_companypersonaccesses', 'access_details_companypersoncompany'])]
- private $mission;
- /**
- * @var string
- */
- #[Groups(['othercontact_list_companypersoncompany'])]
- private $companyFullLabelTemplate;
- /**
- * Sets id.
- *
- * @param int $id
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->id = $id;
- return $this;
- }
- /**
- * Gets id.
- *
- * @return int
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Sets company.
- *
- * @param Access $company
- *
- * @return $this
- */
- public function setCompany(Access $company)
- {
- $this->company = $company;
- return $this;
- }
- /**
- * Gets company.
- *
- * @return Access
- */
- public function getCompany()
- {
- return $this->company;
- }
- /**
- * Sets person.
- *
- * @param Access $access
- *
- * @return $this
- */
- public function setAccess(Access $access)
- {
- $this->access = $access;
- return $this;
- }
- /**
- * Gets person.
- *
- * @return Access
- */
- public function getAccess()
- {
- return $this->access;
- }
- /**
- * Sets mission.
- *
- * @param string $mission
- *
- * @return $this
- */
- public function setMission($mission)
- {
- $this->mission = $mission;
- return $this;
- }
- /**
- * Gets mission.
- *
- * @return string
- */
- public function getMission()
- {
- return $this->mission;
- }
- /**
- * Gets full label.
- *
- * @return string
- */
- public function getCompanyFullLabelTemplate()
- {
- return [
- $this->getCompany()->getPerson()->getName(),
- $this->getMission()
- ];
- }
- }
|