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