src/Entity/Projects.php line 27

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProjectsRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\Common\Collections\Selectable;
  7. use Doctrine\ORM\Event\LifecycleEventArgs;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Doctrine\ORM\PersistentCollection;
  10. use phpDocumentor\Reflection\Types\Float_;
  11. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  12. use function PHPSTORM_META\map;
  13. use function Sodium\add;
  14. use function Sodium\crypto_generichash_final;
  15. use Symfony\Component\Serializer\Annotation\Groups;
  16. /**
  17.  * @ORM\Entity(repositoryClass=ProjectsRepository::class)
  18.  * @ORM\HasLifecycleCallbacks
  19.  * @UniqueEntity(
  20.  *     fields={"project_id", "owner"},
  21.  *     message="Project for Owner already registered|Project %s for %s already registered!"
  22.  * )
  23.  */
  24. class Projects
  25. {
  26.     /*
  27.      * @ORM\PostLoad
  28.      * @ORM\PrePersist
  29.      * @ORM\PreUpdate
  30.      * @param LifecycleEventArgs $lifecycleEventArgs
  31.         public function init( LifecycleEventArgs $lifecycleEventArgs ){
  32.             $this->setTotalCost(); 
  33.         }
  34.         */
  35.     // TODO replace project.base with project.core
  36.     /**
  37.      * @ORM\Id
  38.      * @ORM\GeneratedValue
  39.      * @ORM\Column(type="integer")
  40.      * @Groups({
  41.      *     "project.base",
  42.      *     "project.core",
  43.      *     "project.selectable.list",
  44.      *     "partner.manage.base",
  45.      *     "stakeholder.selected.core.project.manage",
  46.      *     "partner.selected.project",
  47.      *     "worker.join.to.project",
  48.      *     "worker.manage.joined.projects",
  49.      *     "worker.manage.selectable.stakeholder.projects",
  50.      *     "selected.partner.project.for.worker",
  51.      *     "worker.manage.selected.worker.in.project",
  52.      *     "worker.manage.base.timesheet.payments",
  53.      *
  54.      *     "partner.selected.project",
  55.      *
  56.      *
  57.      *     "project.list.with.necessary.details",
  58.      *     "project.details",
  59.      *
  60.      *     "order.assigned.project.minify",
  61.      *
  62.      *     "project.details.for.collected.timesheet",
  63.      *
  64.      *
  65.      *     "project@ref",
  66.      *     "project@base",
  67.      *     "project@core"
  68.      *
  69.      *
  70.      * })
  71.      */
  72.         #"project.orders.expense.position.base"
  73.     private $id;
  74.     /**
  75.      * @ORM\Column(type="string", length=255)
  76.      * @Groups({"project.base",
  77.      *     "project.core",
  78.      *     "project.selectable.list",
  79.      *     "partner.manage.base",
  80.      *     "stakeholder.selected.core.project.manage",
  81.      *     "partner.selected.project",
  82.      *     "worker.join.to.project",
  83.      *     "worker.manage.joined.projects",
  84.      *     "worker.manage.selectable.stakeholder.projects",
  85.      *     "selected.partner.project.for.worker",
  86.      *     "worker.manage.selected.worker.in.project",
  87.      *     "worker.manage.base.timesheet.payments",
  88.      *     "timesheet.for.partner",
  89.      *
  90.      *     "partner.selected.project",
  91.      *     "project.list.with.necessary.details",
  92.      *
  93.      *     "project.details",
  94.      *
  95.      *     "order.assigned.project.minify",
  96.      *
  97.      *     "project.details.for.collected.timesheet",
  98.      *
  99.      *     "project@ref",
  100.      *     "project@base",
  101.      *     "project@core"
  102.      *
  103.      *     })
  104.      */
  105.     #"project.orders.expense.position.base"
  106.     private $name;
  107.     /**
  108.      * @ORM\Column(type="datetime_immutable", nullable=true)
  109.      * @Groups({"project.base",
  110.      *     "project.core",
  111.      *     "partner.manage.base",
  112.      *     "stakeholder.selected.core.project.manage",
  113.      *     "partner.selected.project",
  114.      *     "worker.manage.joined.projects",
  115.      *     "selected.partner.project.for.worker",
  116.      *     "worker.manage.selected.worker.in.project",
  117.      *     "project.list.with.necessary.details",
  118.      *
  119.      *
  120.      *     "project.details",
  121.      *
  122.      *     "project@core",
  123.      *     "project@base"
  124.      * })
  125.      */
  126.     private $start_at;
  127.     /**
  128.      * @ORM\Column(type="datetime_immutable", nullable=true)
  129.      * @Groups({"project.base",
  130.      *     "project.core",
  131.      *     "partner.manage.base",
  132.      *     "stakeholder.selected.core.project.manage",
  133.      *     "partner.selected.project",
  134.      *     "worker.manage.joined.projects",
  135.      *     "selected.partner.project.for.worker",
  136.      *     "worker.manage.selected.worker.in.project",
  137.      *     "project.list.with.necessary.details",
  138.      *
  139.      *
  140.      *     "project.details",
  141.      *
  142.      *     "project@core",
  143.      *     "project@base"
  144.      * })
  145.      */
  146.     private $end_at;
  147.     /**
  148.      * @ORM\Column(type="datetime_immutable")
  149.      * @Groups({
  150.      *     "project@core"
  151.      * })
  152.      */
  153.     private $created_at;
  154.     /**
  155.      * @ORM\OneToMany(targetEntity=ProjectStakeholders::class, mappedBy="project")
  156.      */
  157.     private $stakeholders;
  158.     /**
  159.      * @ORM\ManyToMany(targetEntity=Qualification::class, inversedBy="projects")
  160.      * @ORM\JoinColumn(onDelete="CASCADE")
  161.      * @Groups({
  162.      *     "project.qualifications",
  163.      *     "partner.manage.base",
  164.      *     "stakeholder.selected.core.project.manage",
  165.      *     "partner.selected.project",
  166.      *     "selected.partner.project.for.worker",
  167.      *     "worker.manage.selected.worker.in.project",
  168.      *
  169.      *
  170.      *     "project@qualifications"
  171.      * })
  172.      *
  173.      */
  174.     private $dependent_qualifications;
  175.     /**
  176.      * @ORM\ManyToMany(targetEntity=Certificates::class, inversedBy="projects")
  177.      * @ORM\JoinColumn(onDelete="CASCADE")
  178.      * @Groups({
  179.      *     "project.certificates",
  180.      *     "partner.manage.base",
  181.      *     "stakeholder.selected.core.project.manage",
  182.      *     "partner.selected.project",
  183.      *     "selected.partner.project.for.worker",
  184.      *     "worker.manage.selected.worker.in.project",
  185.      
  186.      *     "project@certificates"
  187.      * })
  188.      */
  189.     private $dependent_certificates;
  190.     /**
  191.      * TODO replace with customer
  192.      * @ORM\ManyToOne(targetEntity=ProjectOwner::class, inversedBy="projects")
  193.      * @ORM\JoinColumn(nullable=true)
  194.      * @Groups({
  195.      *     "project.owner",
  196.      *     "project.list.with.necessary.details",
  197.      *     "project.details",
  198.      *
  199.      *     "project.details.for.collected.timesheet",
  200.      *
  201.      *     "project@owner"
  202.      * })
  203.      */
  204.     private $owner;
  205.     /**
  206.      * @ORM\ManyToOne(targetEntity=Countries::class, inversedBy="projects")
  207.      * @Groups({
  208.      *     "project.base",
  209.      *     "project.core",
  210.      *     "project.list.with.necessary.details",
  211.      *     "project.details",
  212.      *
  213.      *
  214.      *     "project@country"
  215.      * })
  216.      */
  217.     private Countries $country;
  218.     /**
  219.      * @ORM\Column(type="string", length=64, nullable=true )
  220.      * @Groups({
  221.      *     "project.base",
  222.      *     "project.core",
  223.      *     "partner.manage.base",
  224.      *     "project.list.with.necessary.details",
  225.      *     
  226.      *      "project.selectable.list",
  227.      *      "stakeholder.selected.core.project.manage",
  228.      *      "partner.selected.project",
  229.      *      "worker.manage.selectable.stakeholder.projects",
  230.      *      "selected.partner.project.for.worker",
  231.      *      "worker.manage.selected.worker.in.project",
  232.      *      "worker.manage.joined.projects",
  233.      *
  234.      *
  235.      *     "project.details",
  236.      *
  237.      *     "project.details.for.collected.timesheet",
  238.      *
  239.      *
  240.      *     "project@base",
  241.      *     "project@core"
  242.      *
  243.      *
  244.      * })
  245.      */
  246.     #"project.orders.expense.position.base"
  247.     private ?string $project_id;
  248.     /**
  249.      * @ORM\OneToMany(targetEntity=ProjectAddendumCosts::class, mappedBy="project", cascade={"persist", "remove"})
  250.      * @ORM\OrderBy({"id":"DESC"})
  251.      * @ORM\JoinColumn(onDelete="CASCADE")
  252.      * @Groups({
  253.      *     "partner.manage.base",
  254.      *     "project.list.with.necessary.details",
  255.      *     "project.details",
  256.      *
  257.      *     "project@costs"
  258.      * })
  259.      */
  260.     private $project_addendum_costs;
  261.     /**
  262.      * ----------------------------------------------------------------------------------------------------------------
  263.      * This is custom column not associated to table
  264.      * Event Listener Prop
  265.      * This prop Update during event.listener
  266.      * @Groups({
  267.      *     "project.base",
  268.      *     "project.core",
  269.      *     "project.selectable.list",
  270.      *     "partner.manage.base",
  271.      *     "stakeholder.selected.core.project.manage",
  272.      *     "partner.selected.project",
  273.      *     "worker.manage.joined.projects",
  274.      *     "worker.manage.selectable.stakeholder.projects",
  275.      *     "selected.partner.project.for.worker",
  276.      *     "worker.manage.selected.worker.in.project",
  277.      *     "project.list.with.necessary.details",
  278.      *
  279.      *     "project@core"
  280.      * })
  281.      */
  282.     private array $status;
  283.     /**
  284.      * Event Listener Prop
  285.      * This prop Update during event.listener
  286.      * @param array $status
  287.      */
  288.     public function setStatus(array $status ): void {
  289.         $this->status $status;
  290.     }
  291.     /** * Event Listener Prop */
  292.     public function getStatus(): array {
  293.         return $this->status;
  294.     }
  295.     // ----------------------------------------------------------------------------------------------------------------
  296.     /**
  297.      * @Groups({
  298.      *     "project.base",
  299.      *     "project.core",
  300.      *     "project.details",
  301.      *
  302.      *     "project@core"
  303.      * })
  304.      */
  305.     private array $total_cost;
  306.     /**
  307.      * TODO bunu incele cunku Project_order_expenses olayi var
  308.      * @deprecated
  309.      * @ORM\OneToMany(targetEntity=ProjectExpense::class, mappedBy="project", orphanRemoval=true)
  310.      * @ORM\JoinColumn(onDelete="CASCADE", nullable=true)
  311.      * @Groups({
  312.      *     "project.expenses",
  313.      *
  314.      *     "project@expenses"
  315.      * })
  316.      */
  317.     private $project_expenses;
  318.     /**
  319.      * @ORM\Column(type="text", nullable=true)
  320.      * @Groups({
  321.      *     "project.base",
  322.      *     "project.core",
  323.      *
  324.      *     "project@core"
  325.      * })
  326.      */
  327.     private ?string $qr_code '';
  328.     /**
  329.      * @ORM\Column(type="text", nullable=true)
  330.      * @Groups({
  331.      *     "project.base",
  332.      *     "project.core",
  333.      *
  334.      *     "project@address"
  335.      * })
  336.      */
  337.     private ?string $address;
  338.     /**
  339.      * @deprecated
  340.      * @ORM\Column(type="string", length=255, nullable=true, unique=false )
  341.      * @Groups({
  342.      *     "project.base",
  343.      *     "project.core",
  344.      *
  345.      *     "project@core"
  346.      *
  347.      * })
  348.      */
  349.     private $longitude;
  350.     /**
  351.      * @deprecated
  352.      * @ORM\Column(type="string", length=255, nullable=true, unique=false )
  353.      * @Groups({
  354.      *     "project.base",
  355.      *     "project.core",
  356.      *
  357.      *     "project@core"
  358.      * })
  359.      */
  360.     private $latitude;
  361.     /**
  362.      * @deprecated
  363.      * @ORM\Column(type="integer", nullable=true)
  364.      * @Groups({
  365.      *     "project.base",
  366.      *     "project.core",
  367.      *
  368.      *     "project@core"
  369.      * })
  370.      */
  371.     private $scan_distance;
  372.     /**
  373.      * @ORM\Column(type="integer", nullable=true)
  374.      * @Groups({
  375.      *     "project.base",
  376.      *     "project.core",
  377.      *
  378.      *     "project@core"
  379.      * })
  380.      */
  381.     private ?int $reward_time;
  382.     /**
  383.      * @ORM\Column(type="integer", nullable=true)
  384.      * @Groups({
  385.      *     "project.base",
  386.      *     "project.core",
  387.      *
  388.      *     "project@core"
  389.      * })
  390.      */
  391.     private ?int $work_pause;
  392.     /**
  393.      * @ORM\Column(type="string", length=10, nullable=true)
  394.      * @Groups({
  395.      *     "project.base",
  396.      *     "project.core",
  397.      *
  398.      *     "project@core"
  399.      * })
  400.      */
  401.     private ?string $working_time_start;
  402.     /**
  403.      * @ORM\Column(type="string", length=10, nullable=true)
  404.      * @Groups({
  405.      *     "project.base",
  406.      *     "project.core",
  407.      *
  408.      *     "project@core"
  409.      * })
  410.      */
  411.     private ?string $working_time_stop;
  412.     /**
  413.      * @deprecated use address
  414.      * @ORM\Column(type="string", length=12, nullable=true)
  415.      * @Groups({
  416.      *     "project.base",
  417.      *     "project.core",
  418.      *
  419.      *     "project@core"
  420.      *
  421.      *
  422.      * })
  423.      */
  424.     private ?string $code_postal;
  425.     /**
  426.      * @deprecated use address
  427.      * @ORM\Column(type="string", length=64, nullable=true)
  428.      * @Groups({
  429.      *     "project.base",
  430.      *     "project.core",
  431.      *     "project.list.with.necessary.details",
  432.      *
  433.      *     "project@core"
  434.      * })
  435.      */
  436.     private ?string $town;
  437.     /**
  438.      * TODO Remove this permanently
  439.      * ⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️ Use Branch Instead ⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️
  440.      * @deprecated use ManyToMany ❌❌❌❌❌❌
  441.      * @ORM\OneToMany(targetEntity=ProjectBranches::class, mappedBy="project", cascade={"persist", "remove"}, orphanRemoval=true, fetch="EAGER")
  442.      * @Groups({
  443.      *     "project.branches", "partner.manage.base", "stakeholder.selected.core.project.manage",
  444.      *     "worker.manage.selected.worker.in.project", "selected.partner.project.for.worker", "partner.selected.project", "project.details.for.collected.timesheet",
  445.      *
  446.      *     "project@project_branches"
  447.      * })
  448.      */
  449.     private $project_branches;
  450.     /**
  451.      * ✅✅✅✅✅✅✅✅
  452.      * @ORM\ManyToMany(targetEntity=Branches::class, inversedBy="projects")
  453.      * @Groups({
  454.      *     "project@branches"
  455.      * })
  456.      */
  457.     private $branches;
  458.     /**
  459.      * @ORM\OneToMany(targetEntity=ProjectOrders::class, mappedBy="project", orphanRemoval=true, cascade={"persist", "remove"})
  460.      * @Groups({
  461.      *     "project.orders",
  462.      *     "worker.manage.base.timesheet",
  463.      *     "partner.selected.project",
  464.      *     "project.list.with.necessary.details",
  465.      *     "project.details",
  466.      *
  467.      *     "project.details.orders",
  468.      *
  469.      *     "project.details.for.collected.timesheet",
  470.      *
  471.      *     "project@orders"
  472.      * })
  473.      */
  474.     private $project_orders;
  475.     /**
  476.      * @ORM\OneToMany(targetEntity=WorkerTimesheetPayments::class, mappedBy="project")
  477.      */
  478.     private $worker_timesheet_payments;
  479.     /**
  480.      * @ORM\ManyToOne(targetEntity=InvoiceType::class, inversedBy="projects")
  481.      * @Groups({
  482.      *     "project.details",
  483.      *     "project.base",
  484.      *     "project.core",
  485.      *
  486.      *     "project@invoice_type"
  487.      * })
  488.      */
  489.     private $invoice_type;
  490.     /**
  491.      * @deprecated use classify Prop
  492.      * @ORM\Column(type="boolean", nullable=true)
  493.      * @Groups({
  494.      *     "project.details",
  495.      *     "project.base",
  496.      *     "project.core",
  497.      *
  498.      *     "project@core"
  499.      * })
  500.      */
  501.     private $is_archived;
  502.     /**
  503.      * @deprecated use classify Prop
  504.      * @ORM\Column(type="boolean", nullable=true)
  505.      * @Groups({
  506.      *     "project.details",
  507.      *     "project.base",
  508.      *     "project.core",
  509.      *
  510.      *     "project@core"
  511.      * })
  512.      */
  513.     private $is_recycle;
  514.     /**
  515.      * @ORM\OneToOne(targetEntity=ProjectSettings::class, mappedBy="project", cascade={"persist", "remove"})
  516.      * @Groups({
  517.      *     "project.settings",
  518.      *
  519.      *     "project@settings"
  520.      * })
  521.      *
  522.      */
  523.     private $project_settings;
  524.     /**
  525.      * @ORM\OneToOne(targetEntity=ProjectMetrics::class, mappedBy="project", cascade={"persist", "remove"})
  526.      * @Groups({
  527.      *      "project.settings",
  528.      *
  529.      *      "project@metrics"
  530.      *  })
  531.      *  */
  532.     private $project_metrics;
  533.     /**
  534.      * @ORM\OneToMany(targetEntity=ProjectAIReports::class, mappedBy="project", orphanRemoval=true)
  535.      * @Groups({
  536.      *     "project@ai_reports"
  537.      * })
  538.      */
  539.     private $project_ai_reports;
  540.     /**
  541.      * @ORM\ManyToOne(targetEntity=ProjectClassify::class, inversedBy="projects")
  542.      */
  543.     private $classify;
  544.     /**
  545.      * @ORM\Column(type="project_type", nullable=true, options={"default": "project"})
  546.      *  @Groups({
  547.      *     "project@core"
  548.      * })
  549.      */
  550.     private $type;
  551.     public function __construct()
  552.     {
  553.         $this->stakeholders = new ArrayCollection();
  554.         $this->dependent_qualifications = new ArrayCollection();
  555.         $this->dependent_certificates = new ArrayCollection();
  556.         $this->project_addendum_costs = new ArrayCollection();
  557.         $this->project_expenses = new ArrayCollection();
  558.         $this->project_branches = new ArrayCollection();
  559.         $this->project_orders = new ArrayCollection();
  560.         $this->worker_timesheet_payments = new ArrayCollection();
  561.         $this->branches = new ArrayCollection();
  562.         $this->project_ai_reports = new ArrayCollection();
  563.     }
  564.     public function getId(): ?int
  565.     {
  566.         return $this->id;
  567.     }
  568.     public function getName(): ?string
  569.     {
  570.         return $this->name;
  571.     }
  572.     public function setName(string $name): self
  573.     {
  574.         $this->name $name;
  575.         return $this;
  576.     }
  577.     public function getStartAt(): ?\DateTimeImmutable
  578.     {
  579.         return $this->start_at;
  580.     }
  581.     public function setStartAt(?\DateTimeImmutable $start_at): self
  582.     {
  583.         $this->start_at $start_at;
  584.         return $this;
  585.     }
  586.     public function getEndAt(): ?\DateTimeImmutable
  587.     {
  588.         return $this->end_at;
  589.     }
  590.     public function setEndAt(?\DateTimeImmutable $end_at): self
  591.     {
  592.         $this->end_at $end_at;
  593.         return $this;
  594.     }
  595.     public function getCreatedAt(): ?\DateTimeImmutable
  596.     {
  597.         return $this->created_at;
  598.     }
  599.     public function setCreatedAt(\DateTimeImmutable $created_at): self
  600.     {
  601.         $this->created_at $created_at;
  602.         return $this;
  603.     }
  604.     /**
  605.      * @return Collection<int, ProjectStakeholders>&Selectable
  606.      */
  607.     public function getStakeholders(): Collection
  608.     {
  609.         return $this->stakeholders;
  610.     }
  611.     public function addStakeholder(ProjectStakeholders $stakeholder): self
  612.     {
  613.         if (!$this->stakeholders->contains($stakeholder)) {
  614.             $this->stakeholders[] = $stakeholder;
  615.             $stakeholder->setProject($this);
  616.         }
  617.         return $this;
  618.     }
  619.     public function removeStakeholder(ProjectStakeholders $stakeholder): self
  620.     {
  621.         if ($this->stakeholders->removeElement($stakeholder)) {
  622.             // set the owning side to null (unless already changed)
  623.             if ($stakeholder->getProject() === $this) {
  624.                 $stakeholder->setProject(null);
  625.             }
  626.         }
  627.         return $this;
  628.     }
  629.     /**
  630.      * @return Collection<int, Qualification>
  631.      */
  632.     public function getDependentQualifications(): Collection
  633.     {
  634.         return $this->dependent_qualifications;
  635.     }
  636.     public function addDependentQualification(Qualification $dependentQualification): self
  637.     {
  638.         if (!$this->dependent_qualifications->contains($dependentQualification)) {
  639.             $this->dependent_qualifications[] = $dependentQualification;
  640.         }
  641.         return $this;
  642.     }
  643.     public function removeDependentQualification(Qualification $dependentQualification): self
  644.     {
  645.         $this->dependent_qualifications->removeElement($dependentQualification);
  646.         return $this;
  647.     }
  648.     /**
  649.      * @return Collection<int, Certificates>
  650.      */
  651.     public function getDependentCertificates(): Collection
  652.     {
  653.         return $this->dependent_certificates;
  654.     }
  655.     public function addDependentCertificate(Certificates $dependentCertificate): self
  656.     {
  657.         if (!$this->dependent_certificates->contains($dependentCertificate)) {
  658.             $this->dependent_certificates[] = $dependentCertificate;
  659.         }
  660.         return $this;
  661.     }
  662.     public function removeDependentCertificate(Certificates $dependentCertificate): self
  663.     {
  664.         $this->dependent_certificates->removeElement($dependentCertificate);
  665.         return $this;
  666.     }
  667.     public function getOwner(): ?ProjectOwner
  668.     {
  669.         return $this->owner;
  670.     }
  671.     public function setOwner(?ProjectOwner $owner): self
  672.     {
  673.         $this->owner $owner;
  674.         return $this;
  675.     }
  676.     public function getCountry(): ?Countries
  677.     {
  678.         return $this->country;
  679.     }
  680.     public function setCountry(?Countries $country): self
  681.     {
  682.         $this->country $country;
  683.         return $this;
  684.     }
  685.     public function getProjectId(): ?string
  686.     {
  687.         return $this->project_id;
  688.     }
  689.     public function setProjectId(?string $project_id): self
  690.     {
  691.         $this->project_id $project_id;
  692.         return $this;
  693.     }
  694.     /**
  695.      * @return Collection<int, ProjectAddendumCosts>
  696.      */
  697.     public function getProjectAddendumCosts(): Collection
  698.     {
  699.         return $this->project_addendum_costs;
  700.     }
  701.     public function addProjectAddendumCost(ProjectAddendumCosts $projectAddendumCost): self
  702.     {
  703.         if (!$this->project_addendum_costs->contains($projectAddendumCost)) {
  704.             $this->project_addendum_costs[] = $projectAddendumCost;
  705.             $projectAddendumCost->setProject($this);
  706.         }
  707.         return $this;
  708.     }
  709.     public function removeProjectAddendumCost(ProjectAddendumCosts $projectAddendumCost): self
  710.     {
  711.         if ($this->project_addendum_costs->removeElement($projectAddendumCost)) {
  712.             // set the owning side to null (unless already changed)
  713.             if ($projectAddendumCost->getProject() === $this) {
  714.                 $projectAddendumCost->setProject(null);
  715.             }
  716.         }
  717.         return $this;
  718.     }
  719.     public function getTotalCost(): array{
  720.         return $this->total_cost;
  721.     }
  722.     /**
  723.      * @return Collection<int, ProjectExpense>
  724.      */
  725.     public function getProjectExpenses(): Collection
  726.     {
  727.         return $this->project_expenses;
  728.     }
  729.     public function addProjectExpense(ProjectExpense $projectExpense): self
  730.     {
  731.         if (!$this->project_expenses->contains($projectExpense)) {
  732.             $this->project_expenses[] = $projectExpense;
  733.             $projectExpense->setProject($this);
  734.         }
  735.         return $this;
  736.     }
  737.     public function removeProjectExpense(ProjectExpense $projectExpense): self
  738.     {
  739.         if ($this->project_expenses->removeElement($projectExpense)) {
  740.             // set the owning side to null (unless already changed)
  741.             if ($projectExpense->getProject() === $this) {
  742.                 $projectExpense->setProject(null);
  743.             }
  744.         }
  745.         return $this;
  746.     }
  747.     public function getQrCode(): ?string
  748.     {
  749.         return $this->qr_code;
  750.     }
  751.     public function setQrCode(?string $qr_code): self
  752.     {
  753.         $this->qr_code $qr_code;
  754.         return $this;
  755.     }
  756.     public function getLongitude(): ?string
  757.     {
  758.         return $this->longitude;
  759.     }
  760.     public function setLongitude(?string $longitude): self
  761.     {
  762.         $this->longitude $longitude;
  763.         return $this;
  764.     }
  765.     public function getLatitude(): ?string
  766.     {
  767.         return $this->latitude;
  768.     }
  769.     public function setLatitude(?string $latitude): self
  770.     {
  771.         $this->latitude $latitude;
  772.         return $this;
  773.     }
  774.     public function getAddress(): ?string
  775.     {
  776.         return $this->address;
  777.     }
  778.     public function setAddress(?string $address): self
  779.     {
  780.         $this->address $address;
  781.         return $this;
  782.     }
  783.     public function getScanDistance(): ?int
  784.     {
  785.         return $this->scan_distance;
  786.     }
  787.     public function setScanDistance(?int $scan_distance): self
  788.     {
  789.         $this->scan_distance $scan_distance;
  790.         return $this;
  791.     }
  792.     public function getRewardTime(): ?int
  793.     {
  794.         return $this->reward_time;
  795.     }
  796.     public function setRewardTime(?int $reward_time): self
  797.     {
  798.         $this->reward_time $reward_time;
  799.         return $this;
  800.     }
  801.     public function getWorkPause(): ?int
  802.     {
  803.         return $this->work_pause;
  804.     }
  805.     public function setWorkPause(?int $work_pause): self
  806.     {
  807.         $this->work_pause $work_pause;
  808.         return $this;
  809.     }
  810.     public function getWorkingTimeStart(): ?string
  811.     {
  812.         return $this->working_time_start;
  813.     }
  814.     public function setWorkingTimeStart(?string $working_time_start): self
  815.     {
  816.         $this->working_time_start $working_time_start;
  817.         return $this;
  818.     }
  819.     public function getWorkingTimeStop(): ?string
  820.     {
  821.         return $this->working_time_stop;
  822.     }
  823.     public function setWorkingTimeStop(?string $working_time_stop): self
  824.     {
  825.         $this->working_time_stop $working_time_stop;
  826.         return $this;
  827.     }
  828.     public function getCodePostal(): ?string
  829.     {
  830.         return $this->code_postal;
  831.     }
  832.     public function setCodePostal(?string $code_postal): self
  833.     {
  834.         $this->code_postal $code_postal;
  835.         return $this;
  836.     }
  837.     public function getTown(): ?string
  838.     {
  839.         return $this->town;
  840.     }
  841.     public function setTown(?string $town): self
  842.     {
  843.         $this->town $town;
  844.         return $this;
  845.     }
  846.     /**
  847.      * @deprecated
  848.      * Use getBranches
  849.      * @return Collection<int, ProjectBranches>
  850.      */
  851.     public function getProjectBranches(): Collection
  852.     {
  853.         return $this->project_branches;
  854.     }
  855.     /**
  856.      * @deprecated
  857.      * Use addBranches */
  858.     public function addProjectBranch(ProjectBranches $projectBranch): self
  859.     {
  860.         if (!$this->project_branches->contains($projectBranch)) {
  861.             $this->project_branches[] = $projectBranch;
  862.             $projectBranch->setProject($this);
  863.         }
  864.         return $this;
  865.     }
  866.     /**
  867.      * @deprecated
  868.      * Use removeBranches */
  869.     public function removeProjectBranch(ProjectBranches $projectBranch): self
  870.     {
  871.         if ($this->project_branches->removeElement($projectBranch)) {
  872.             // set the owning side to null (unless already changed)
  873.             if ($projectBranch->getProject() === $this) {
  874.                 $projectBranch->setProject(null);
  875.             }
  876.         }
  877.         return $this;
  878.     }
  879.     /**
  880.      * @return Collection<int, ProjectOrder>
  881.      */
  882.     public function getProjectOrders(): Collection
  883.     {
  884.         return $this->project_orders;
  885.     }
  886.     public function addProjectOrder(ProjectOrders $projectOrder): self
  887.     {
  888.         if (!$this->project_orders->contains($projectOrder)) {
  889.             $this->project_orders[] = $projectOrder;
  890.             $projectOrder->setProject($this);
  891.         }
  892.         return $this;
  893.     }
  894.     public function removeProjectOrder(ProjectOrders $projectOrder): self
  895.     {
  896.         if ($this->project_orders->removeElement($projectOrder)) {
  897.             // set the owning side to null (unless already changed)
  898.             if ($projectOrder->getProject() === $this) {
  899.                 $projectOrder->setProject(null);
  900.             }
  901.         }
  902.         return $this;
  903.     }
  904.     /**
  905.      * @return Collection<int, WorkerTimesheetPayments>
  906.      */
  907.     public function getWorkerTimesheetpayments(): Collection
  908.     {
  909.         return $this->worker_timesheet_payments;
  910.     }
  911.     public function addWorkerTimesheetPayment(WorkerTimesheetPayments $workerTimesheetPayment): self
  912.     {
  913.         if (!$this->worker_timesheet_payments->contains($workerTimesheetPayment)) {
  914.             $this->worker_timesheet_payments[] = $workerTimesheetPayment;
  915.             $workerTimesheetPayment->setProject($this);
  916.         }
  917.         return $this;
  918.     }
  919.     public function removeWorkerTimesheetPayment(WorkerTimesheetPayments $workerTimesheetPayment): self
  920.     {
  921.         if ($this->worker_timesheet_payments->removeElement($workerTimesheetPayment)) {
  922.             // set the owning side to null (unless already changed)
  923.             if ($workerTimesheetPayment->getProject() === $this) {
  924.                 $workerTimesheetPayment->setProject(null);
  925.             }
  926.         }
  927.         return $this;
  928.     }
  929.     /**
  930.      * @return Collection<int, OrderBilled>
  931.      */
  932.     public function getInvoiceType(): ?InvoiceType
  933.     {
  934.         return $this->invoice_type;
  935.     }
  936.     public function setInvoiceType(?InvoiceType $invoice_type): self
  937.     {
  938.         $this->invoice_type $invoice_type;
  939.         return $this;
  940.     }
  941.     /**
  942.      * @deprecated use classify Prop
  943.      */
  944.     public function isArchived(): ?bool
  945.     {
  946.         return $this->is_archived;
  947.     }
  948.     /**
  949.      * @deprecated use classify Prop
  950.      */
  951.     public function setIsArchived(?bool $is_archived): self
  952.     {
  953.         $this->is_archived $is_archived;
  954.         return $this;
  955.     }
  956.     /**
  957.      * @deprecated use classify Prop
  958.      */
  959.     public function isRecycle(): ?bool
  960.     {
  961.         return $this->is_recycle;
  962.     }
  963.     /**
  964.      * @deprecated use classify Prop
  965.     */
  966.     public function setIsRecycle(?bool $is_recycle): self
  967.     {
  968.         $this->is_recycle $is_recycle;
  969.         return $this;
  970.     }
  971.     public function getProjectSettings(): ?ProjectSettings
  972.     {
  973.         return $this->project_settings;
  974.     }
  975.     public function setProjectSetting(ProjectSettings $projectSetting): self
  976.     {
  977.         if ($projectSetting->getProject() !== $this) {
  978.             $projectSetting->setProject($this);
  979.         }
  980.         $this->project_settings $projectSetting;
  981.         return $this;
  982.     }
  983.     public function getProjectMetrics(): ?ProjectMetrics
  984.     {
  985.         return $this->project_metrics;
  986.     }
  987.     public function setProjectMetrics(ProjectMetrics $project_metrics): self
  988.     {
  989.         // set the owning side of the relation if necessary
  990.         if ($project_metrics->getProject() !== $this) {
  991.             $project_metrics->setProject($this);
  992.         }
  993.         $this->project_metrics $project_metrics;
  994.         return $this;
  995.     }
  996.     /**
  997.      * @return Collection<int, Branches> & Selectable
  998.      */
  999.     public function getBranches(): Collection
  1000.     {
  1001.         return $this->branches;
  1002.     }
  1003.     public function addBranch(Branches $branch): self
  1004.     {
  1005.         if (!$this->branches->contains($branch)) {
  1006.             $this->branches[] = $branch;
  1007.         }
  1008.         return $this;
  1009.     }
  1010.     public function removeBranch(Branches $branch): self
  1011.     {
  1012.         $this->branches->removeElement($branch);
  1013.         return $this;
  1014.     }
  1015.     /**
  1016.      * @return Collection<int, ProjectAIReports>
  1017.      */
  1018.     public function getProjectAiReports(): Collection
  1019.     {
  1020.         return $this->project_ai_reports;
  1021.     }
  1022.     public function addProjectAiReport(ProjectAIReports $projectAiReport): self
  1023.     {
  1024.         if (!$this->project_ai_reports->contains($projectAiReport)) {
  1025.             $this->project_ai_reports[] = $projectAiReport;
  1026.             $projectAiReport->setProject($this);
  1027.         }
  1028.         return $this;
  1029.     }
  1030.     public function removeProjectAiReport(ProjectAIReports $projectAiReport): self
  1031.     {
  1032.         if ($this->project_ai_reports->removeElement($projectAiReport)) {
  1033.             // set the owning side to null (unless already changed)
  1034.             if ($projectAiReport->getProject() === $this) {
  1035.                 $projectAiReport->setProject(null);
  1036.             }
  1037.         }
  1038.         return $this;
  1039.     }
  1040.     public function getClassify(): ?ProjectClassify
  1041.     {
  1042.         return $this->classify;
  1043.     }
  1044.     public function setClassify(?ProjectClassify $classify): self
  1045.     {
  1046.         $this->classify $classify;
  1047.         return $this;
  1048.     }
  1049.     public function getType()
  1050.     {
  1051.         return $this->type;
  1052.     }
  1053.     public function setType($type): self
  1054.     {
  1055.         $this->type $type;
  1056.         return $this;
  1057.     }
  1058. }