| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343 |
- <?php
- namespace AppBundle\Entity\Core;
- use AppBundle\Entity\AccessAndFunction\Access;
- use Doctrine\ORM\Mapping as ORM;
- use Symfony\Component\Validator\Constraints as Assert;
- use AppBundle\Annotation\ORM as OpentalentORM;
- use Symfony\Component\Serializer\Annotation\Groups;
- /**
- * @OpentalentORM\View(query="
- CREATE OR REPLACE VIEW opentalent.view_audit AS
- (SELECT
- init_var_session() as identifier,
- null as rev,
- a.id,
- null as createDate,
- null as updateDate,
- null as createdBy_id,
- null as updatedBy_id,
- null as revType,
- null as organizationId,
- 'INIT' as tableName
- FROM
- Audit_Organization a
- LIMIT 1)
- UNION
- (SELECT
- func_inc_var_session() as identifier,
- person.rev,
- person.id,
- person.createDate,
- person.updateDate,
- person.createdBy as createdBy_id,
- person.updatedBy as updatedBy_id,
- person.revType,
- IF(Access.organization_id IS NOT NULL,
- Access.organization_id,
- accessPerson2.organization_id) as organizationId,
- 'person' as tableName
- FROM
- opentalent.Audit_Person AS person
- LEFT JOIN
- Access ON Access.id = person.createdBy
- LEFT JOIN
- Access as accessPerson2 ON accessPerson2.id = person.updatedBy
- WHERE
- (Access.organization_id IS NOT NULL
- OR accessPerson2.organization_id IS NOT NULL))
- UNION
- (SELECT
- func_inc_var_session() as identifier,
- donor.rev,
- donor.id,
- donor.createDate,
- donor.updateDate,
- donor.createdBy as createdBy_id,
- donor.updatedBy as updatedBy_id,
- donor.revType,
- Access.organization_id,
- 'donor' as tableName
- FROM
- opentalent.Audit_Donor as donor
- INNER JOIN
- Access ON donor.access_id = Access.id)
- ORDER BY updateDate DESC , createDate DESC")
- */
- #[ORM\Entity(readOnly: true)]
- #[ORM\Table(name: 'view_audit')]
- class ViewAudit
- {
- /**
- * @var int
- */
- #[ORM\Column(type: 'integer')]
- #[ORM\Id]
- #[ORM\GeneratedValue(strategy: 'AUTO')]
- #[Groups(['viewaudit', 'viewaudit_list'])]
- private $identifier;
- /**
- * @var int
- */
- #[ORM\Column(type: 'integer')]
- #[Groups(['viewaudit', 'viewaudit_list'])]
- private $id;
- /**
- * @var int
- */
- #[ORM\Column(type: 'integer')]
- #[Groups(['viewaudit', 'viewaudit_list'])]
- private $rev;
- /**
- * @var \DateTime
- */
- #[ORM\Column(type: 'datetime')]
- #[Assert\Date]
- #[Groups(['viewaudit', 'viewaudit_list'])]
- private $createDate;
- /**
- * @var \DateTime
- */
- #[ORM\Column(type: 'datetime')]
- #[Assert\Date]
- #[Groups(['viewaudit', 'viewaudit_list'])]
- private $updateDate;
- /**
- * @var Access
- */
- #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access')]
- #[ORM\JoinColumn(nullable: true)]
- #[Groups(['viewaudit', 'viewaudit_list'])]
- private $createdBy;
- /**
- * @var Access
- */
- #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access')]
- #[ORM\JoinColumn(nullable: true)]
- #[Groups(['viewaudit', 'viewaudit_list'])]
- private $updatedBy;
- /**
- *
- * @var string
- */
- #[ORM\Column(type: 'string', length: 40)]
- #[Assert\Type(type: 'string')]
- #[Groups(['viewaudit', 'viewaudit_list'])]
- private $revType;
- /**
- * @var int
- */
- #[ORM\Column(type: 'integer')]
- #[ORM\GeneratedValue(strategy: 'AUTO')]
- #[Groups(['viewaudit', 'viewaudit_list'])]
- private $organizationId;
- /**
- *
- * @var string
- */
- #[ORM\Column(type: 'string', length: 40)]
- #[Assert\Type(type: 'string')]
- #[Groups(['viewaudit', 'viewaudit_list'])]
- private $tableName;
- /**
- * @return int
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * @param int $id
- */
- public function setId($id)
- {
- $this->id = $id;
- }
- /**
- * Set rev
- *
- * @param integer $rev
- *
- * @return ViewAudit
- */
- public function setRev($rev)
- {
- $this->rev = $rev;
- return $this;
- }
- /**
- * Get rev
- *
- * @return integer
- */
- public function getRev()
- {
- return $this->rev;
- }
- /**
- * Set createDate
- *
- * @param \DateTime $createDate
- *
- * @return ViewAudit
- */
- public function setCreateDate($createDate)
- {
- $this->createDate = $createDate;
- return $this;
- }
- /**
- * Get createDate
- *
- * @return \DateTime
- */
- public function getCreateDate()
- {
- return $this->createDate;
- }
- /**
- * Set updateDate
- *
- * @param \DateTime $updateDate
- *
- * @return ViewAudit
- */
- public function setUpdateDate($updateDate)
- {
- $this->updateDate = $updateDate;
- return $this;
- }
- /**
- * Get updateDate
- *
- * @return \DateTime
- */
- public function getUpdateDate()
- {
- return $this->updateDate;
- }
- /**
- * Set revType
- *
- * @param string $revType
- *
- * @return ViewAudit
- */
- public function setRevType($revType)
- {
- $this->revType = $revType;
- return $this;
- }
- /**
- * Get revType
- *
- * @return string
- */
- public function getRevType()
- {
- return $this->revType;
- }
- /**
- * Set organizationId
- *
- * @param integer $organizationId
- *
- * @return ViewAudit
- */
- public function setOrganizationId($organizationId)
- {
- $this->organizationId = $organizationId;
- return $this;
- }
- /**
- * Get organizationId
- *
- * @return integer
- */
- public function getOrganizationId()
- {
- return $this->organizationId;
- }
- /**
- * Set tableName
- *
- * @param string $tableName
- *
- * @return ViewAudit
- */
- public function setTableName($tableName)
- {
- $this->tableName = $tableName;
- return $this;
- }
- /**
- * Get tableName
- *
- * @return string
- */
- public function getTableName()
- {
- return $this->tableName;
- }
- /**
- * Set createdBy
- *
- * @param \AppBundle\Entity\AccessAndFunction\Access $createdBy
- *
- * @return ViewAudit
- */
- public function setCreatedBy(\AppBundle\Entity\AccessAndFunction\Access $createdBy = null)
- {
- $this->createdBy = $createdBy;
- return $this;
- }
- /**
- * Get createdBy
- *
- * @return \AppBundle\Entity\AccessAndFunction\Access
- */
- public function getCreatedBy()
- {
- return $this->createdBy;
- }
- /**
- * Set updatedBy
- *
- * @param \AppBundle\Entity\AccessAndFunction\Access $updatedBy
- *
- * @return ViewAudit
- */
- public function setUpdatedBy(\AppBundle\Entity\AccessAndFunction\Access $updatedBy = null)
- {
- $this->updatedBy = $updatedBy;
- return $this;
- }
- /**
- * Get updatedBy
- *
- * @return \AppBundle\Entity\AccessAndFunction\Access
- */
- public function getUpdatedBy()
- {
- return $this->updatedBy;
- }
- /**
- * Get identifier
- *
- * @return integer
- */
- public function getIdentifier()
- {
- return $this->identifier;
- }
- }
|