src/Entity/Policy.php line 92

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use ApiPlatform\Core\Annotation\ApiProperty;
  5. use ApiPlatform\Core\Annotation\ApiResource;
  6. use ApiPlatform\Core\Annotation\ApiFilter;
  7. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
  8. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\OrderFilter;
  9. use App\Trait\TimestampableEntity;
  10. use Doctrine\Common\Collections\ArrayCollection;
  11. use Doctrine\Common\Collections\Collection;
  12. use Doctrine\ORM\Mapping as ORM;
  13. use Symfony\Component\Validator\Constraints as Assert;
  14. use Symfony\Component\Serializer\Annotation\Groups;
  15. use Symfony\Component\Serializer\Annotation\MaxDepth;
  16. #[ORM\Entity]
  17. #[ApiResource(
  18.     iri'Policy',
  19.     itemOperations: [
  20.         'get' => [
  21.             // 'security' => "is_granted('ROLE_USER')",
  22.             'normalization_context' => [
  23.                 'groups' => 'policy:item:get',
  24.                 'enable_max_depth' => true
  25.             ]
  26.         ],
  27.         'put' => [
  28.             // 'security' => "is_granted('ROLE_USER')",
  29.             'normalization_context' => [
  30.                 'groups' => 'policy:item:put',
  31.                 'enable_max_depth' => true
  32.             ],
  33.             'denormalization_context' => [
  34.                 'groups' => 'policy:item:put',
  35.                 'enable_max_depth' => true
  36.             ]
  37.         ],
  38.         'delete' => [
  39.             // 'security' => "is_granted('ROLE_USER')",
  40.         ]
  41.     ],
  42.     collectionOperations: [
  43.         'get' => [
  44.             // 'security' => "is_granted('ROLE_USER')",
  45.             'normalization_context' => [
  46.                 'groups' => ['policy:collection:get''createdAt'],
  47.                 'enable_max_depth' => true
  48.             ]
  49.         ],
  50.         'post' => [
  51.             // 'security' => "is_granted('ROLE_USER')",
  52.             'normalization_context' => [
  53.                 'groups' => 'policy:collection:post',
  54.                 'enable_max_depth' => true
  55.             ],
  56.             'denormalization_context' => [
  57.                 'groups' => 'policy:collection:post',
  58.                 'enable_max_depth' => true
  59.             ]
  60.         ],
  61.     ]
  62. )]
  63. #[ApiFilter(SearchFilter::class, properties: [
  64.     'insured' => 'exact',
  65.     'status' => 'exact',
  66.     'policyNumber' => 'start',
  67.     'insured.name' => 'partial',
  68.     'insured.taxID' => 'start',
  69.     'holderName' => 'partial',
  70.     'holderTaxID' => 'start',
  71.     'processNumber' => 'start',
  72.     'interestRate' => 'start',
  73.     'eligibleQuantity' => 'start',
  74.     'createdAt' => 'start',
  75. ])]
  76. #[ApiFilter(OrderFilter::class, properties: [
  77.     'policyNumber'
  78.     'processNumber'
  79.     'status',
  80.     'createdAt',
  81.     'interestRate',
  82.     'eligibleQuantity',
  83.     'insured.taxID',
  84.     'insured.name',
  85.     'holderName',
  86.     'holderTaxID',
  87. ])]
  88. class Policy
  89. {
  90.     use TimestampableEntity;
  91.     
  92.     #[ORM\Id]
  93.     #[ORM\GeneratedValue(strategy'AUTO')]
  94.     #[ORM\Column(type'integer')]
  95.     #[Groups([
  96.         'policy:collection:get',
  97.         'policy:item:get',
  98.     ])]
  99.     private ?int $id null;
  100.     #[ORM\Column(type'string')]
  101.     #[ApiProperty(iri'https://schema.org/Number')]
  102.     #[Assert\Type('string')]
  103.     #[Groups([
  104.         'import:policy',
  105.         'policy:collection:get',
  106.         'policy:collection:post',
  107.         'policy:item:get',
  108.         'policy:item:put',
  109.         'demand:item:get',
  110.     ])]
  111.     private ?string $policyNumber null;
  112.     #[ORM\Column(type'string'nullabletrue)]
  113.     #[ApiProperty(iri'https://schema.org/Number')]
  114.     #[Assert\Type('string')]
  115.     #[Groups([
  116.         'import:policy',
  117.         'policy:collection:get',
  118.         'policy:collection:post',
  119.         'policy:item:get',
  120.         'policy:item:put',
  121.     ])]
  122.     private ?string $processNumber null;
  123.     /**
  124.      * The name of the item.
  125.      *
  126.      * @see https://schema.org/name
  127.      */
  128.     #[ORM\Column(type'string'nullabletrue)]
  129.     #[ApiProperty(iri'https://schema.org/name')]
  130.     #[Assert\Type('string')]
  131.     #[Groups([
  132.         'import:policy',
  133.         'policy:collection:get',
  134.         'policy:collection:post',
  135.         'policy:item:get',
  136.         'policy:item:put',
  137.     ])]
  138.     private ?string $holderName null;
  139.     #[ORM\Column(type'string'nullabletrue)]
  140.     #[ApiProperty()]
  141.     #[Assert\Type('string')]
  142.     #[Groups([
  143.         'import:policy',
  144.         'policy:collection:post',
  145.         'policy:item:get',
  146.         'policy:item:put',
  147.     ])]
  148.     private ?string $holderZipcode null;
  149.     #[ORM\Column(type'string'nullabletrue)]
  150.     #[ApiProperty()]
  151.     #[Assert\Type('string')]
  152.     #[Groups([
  153.         'import:policy',
  154.         'policy:collection:post',
  155.         'policy:item:get',
  156.         'policy:item:put',
  157.     ])]
  158.     private ?string $holderAddress null;
  159.     #[ORM\Column(type'string'nullabletrue)]
  160.     #[ApiProperty()]
  161.     #[Assert\Type('string')]
  162.     #[Groups([
  163.         'import:policy',
  164.         'policy:collection:post',
  165.         'policy:item:get',
  166.         'policy:item:put',
  167.     ])]
  168.     private ?string $holderComplement null;
  169.     #[ORM\Column(type'string'nullabletrue)]
  170.     #[ApiProperty()]
  171.     #[Assert\Type('string')]
  172.     #[Groups([
  173.         'import:policy',
  174.         'policy:collection:post',
  175.         'policy:item:get',
  176.         'policy:item:put',
  177.     ])]
  178.     private ?string $holderNeighborhood null;
  179.     #[ORM\Column(type'string'nullabletrue)]
  180.     #[ApiProperty()]
  181.     #[Assert\Type('string')]
  182.     #[Groups([
  183.         'import:policy',
  184.         'policy:collection:post',
  185.         'policy:item:get',
  186.         'policy:item:put',
  187.     ])]
  188.     private ?string $holderCity null;
  189.     #[ORM\Column(type'string'nullabletrue)]
  190.     #[ApiProperty()]
  191.     #[Assert\Type('string')]
  192.     #[Groups([
  193.         'import:policy',
  194.         'policy:collection:post',
  195.         'policy:item:get',
  196.         'policy:item:put',
  197.     ])]
  198.     private ?string $holderState null;
  199.     #[ORM\Column(type'string'nullabletrue)]
  200.     #[ApiProperty()]
  201.     #[Assert\Type('string')]
  202.     #[Groups([
  203.         'import:policy',
  204.         'policy:collection:get',
  205.         'policy:collection:post',
  206.         'policy:item:get',
  207.         'policy:item:put',
  208.     ])]
  209.     private ?string $holderTaxIDType null;
  210.     /**
  211.      * The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.
  212.      *
  213.      * @see https://schema.org/taxID
  214.      */
  215.     #[ORM\Column(type'string'nullabletrue)]
  216.     #[ApiProperty(iri'https://schema.org/taxID')]
  217.     #[Assert\Type('string')]
  218.     #[Groups([
  219.         'import:policy',
  220.         'policy:collection:get',
  221.         'policy:collection:post',
  222.         'policy:item:get',
  223.         'policy:item:put',
  224.     ])]
  225.     private ?string $holderTaxID null;
  226.     #[ORM\Column(type'text'nullabletrue)]
  227.     #[ApiProperty(iri'https://schema.org/Text')]
  228.     #[Groups([
  229.         'import:policy',
  230.         'policy:collection:get',
  231.         'policy:collection:post',
  232.         'policy:item:get',
  233.         'policy:item:put',
  234.     ])]
  235.     private ?string $paymentMethod null;
  236.     #[ORM\Column(type'text'nullabletrue)]
  237.     #[ApiProperty(iri'https://schema.org/description')]
  238.     #[Groups([
  239.         'import:policy',
  240.         'policy:collection:get',
  241.         'policy:collection:post',
  242.         'policy:item:get',
  243.         'policy:item:put',
  244.     ])]
  245.     private ?string $observations null;
  246.     #[ORM\Column(type'float'nullabletrue)]
  247.     #[ApiProperty(iri'https://schema.org/Number')]
  248.     #[Groups([
  249.         'policy:collection:get',
  250.         'policy:collection:post',
  251.         'policy:item:get',
  252.         'policy:item:put',
  253.         'demand:collection:get',
  254.     ])]
  255.     private ?float $eligibleQuantity null;
  256.     #[ORM\Column(type'float'nullabletrue)]
  257.     #[ApiProperty(iri'https://schema.org/interestRate')]
  258.     #[Groups([
  259.         'import:policy',
  260.         'policy:collection:get',
  261.         'policy:collection:post',
  262.         'policy:item:get',
  263.         'policy:item:put',
  264.         'demand:item:get',
  265.     ])]
  266.     private ?float $interestRate null;
  267.     #[ORM\Column(type'float'nullabletrue)]
  268.     #[ApiProperty(iri'https://schema.org/Number')]
  269.     #[Groups([
  270.         'policy:collection:get',
  271.         'policy:collection:post',
  272.         'policy:item:get',
  273.         'policy:item:put',
  274.         'demand:collection:get',
  275.     ])]
  276.     private ?float $insurancePremium null;
  277.     #[ORM\Column(type'float'nullabletrue)]
  278.     #[ApiProperty(iri'https://schema.org/Number')]
  279.     #[Groups([
  280.         'import:policy',
  281.         'policy:collection:post',
  282.         'policy:item:get',
  283.         'policy:item:put',
  284.     ])]
  285.     private ?float $interestFee null;
  286.     #[ORM\Column(type'float'nullabletrue)]
  287.     #[ApiProperty(iri'https://schema.org/Number')]
  288.     #[Groups([
  289.         'policy:collection:get',
  290.         'policy:collection:post',
  291.         'policy:item:get',
  292.         'policy:item:put',
  293.         'demand:collection:get',
  294.     ])]
  295.     private ?float $commission null;
  296.     #[ORM\Column(type'boolean'nullablefalse)]
  297.     #[ApiProperty(iri'https://schema.org/Boolean')]
  298.     #[Assert\Type('boolean')]
  299.     #[Groups([
  300.         'import:policy',
  301.         'policy:collection:post',
  302.         'policy:item:get',
  303.         'policy:item:put',
  304.     ])]
  305.     private ?bool $hasParentOrganization null;
  306.     #[ORM\Column(type'string'nullablefalse)]
  307.     #[ApiProperty(iri'https://schema.org/Text')]
  308.     #[Assert\Type('string')]
  309.     #[Groups([
  310.         'import:policy',
  311.         'policy:collection:get',
  312.         'policy:collection:post',
  313.         'policy:item:get',
  314.         'policy:item:put',
  315.         'demand:item:get',
  316.     ])]
  317.     private ?string $status null;
  318.     #[ORM\OneToMany(mappedBy'policy'targetEntityEndorsement::class, cascade: ["remove"], orphanRemovaltrue)]
  319.     #[Groups([
  320.         'policy:item:get',
  321.     ])]
  322.     #[MaxDepth(1)]
  323.     private $endorsements;
  324.     #[ORM\OneToMany(mappedBy'policy'targetEntityPolicyUpload::class, cascade: ["remove"], orphanRemovaltrue)]
  325.     #[Groups([
  326.         'policy:item:get',
  327.     ])]
  328.     #[MaxDepth(1)]
  329.     private $uploads;
  330.     #[ORM\OneToMany(mappedBy'policy'targetEntityPolicyInsurer::class, cascade: ["persist""remove"], orphanRemovaltrue)]
  331.     #[Groups([
  332.         'import:policy',
  333.         'policy:collection:get',
  334.         'policy:collection:post',
  335.         'policy:item:get',
  336.         'policy:item:put',
  337.         'demand:item:get',
  338.     ])]
  339.     #[MaxDepth(1)]
  340.     private $insurers;
  341.     #[ORM\ManyToOne(targetEntityInsurer::class)]
  342.     #[Groups([
  343.         'policy:collection:post',
  344.         'policy:item:get',
  345.         'policy:item:put',
  346.         'demand:item:get',
  347.     ])]
  348.     #[MaxDepth(1)]
  349.     private $insurerLeader;
  350.     #[ApiProperty()]
  351.     #[Groups([
  352.       'import:insurer',
  353.       'insurer:item:get'
  354.       'insurer:collection:get',  
  355.       'policy:collection:get',
  356.     ])]
  357.     private $insurerLeaderName;   
  358.     #[ApiProperty()]
  359.     #[Groups([
  360.         'import:policy',
  361.     ])]
  362.     private $insurerLeaderTaxID;
  363.     #[ORM\ManyToOne(targetEntityInsured::class, inversedBy'policies')]
  364.     #[Groups([
  365.         'policy:collection:post',
  366.         'policy:item:get',
  367.         'policy:item:put',
  368.         'policy:collection:get',
  369.     ])]
  370.     #[MaxDepth(1)]
  371.     private $insured;
  372.     #[ApiProperty()]
  373.     #[Groups([
  374.         'import:policy',
  375.     ])]
  376.     private $insuredTaxID;
  377.     #[ORM\OneToOne(mappedBy'policy'targetEntityDemand::class, cascade: ["remove"], orphanRemovaltrue)]
  378.     #[Groups([
  379.         'policy:collection:get',
  380.         'policy:collection:post',
  381.         'policy:item:get',
  382.         'policy:item:put',     
  383.     ])]
  384.     #[MaxDepth(1)]
  385.     private $demand;
  386.     #[ApiProperty()]
  387.     #[Groups([
  388.       'import:demand',
  389.       'demand:item:get'
  390.       'demand:collection:get',  
  391.       'policy:collection:get',
  392.     ])]
  393.     private $demandEndTime;       
  394.     public function __construct()
  395.     {
  396.         $this->endorsements = new ArrayCollection();
  397.         $this->insurers = new ArrayCollection();
  398.         $this->uploads = new ArrayCollection();
  399.     }
  400.     public function getId(): ?int
  401.     {
  402.         return $this->id;
  403.     }
  404.     /**
  405.      * @param string|null $policyNumber
  406.      */
  407.     public function setPolicyNumber($policyNumber): void
  408.     {
  409.         $this->policyNumber $policyNumber;
  410.     }
  411.     public function getPolicyNumber(): ?string
  412.     {
  413.         return $this->policyNumber;
  414.     }
  415.     /**
  416.      * @param string|null $processNumber
  417.      */
  418.     public function setProcessNumber($processNumber): void
  419.     {
  420.         $this->processNumber $processNumber;
  421.     }
  422.     public function getProcessNumber(): ?string
  423.     {
  424.         return $this->processNumber;
  425.     }
  426.     public function setHolderName(?string $holderName): void
  427.     {
  428.         $this->holderName $holderName;
  429.     }
  430.     public function getHolderName(): ?string
  431.     {
  432.         return $this->holderName;
  433.     }
  434.     public function getHolderZipcode(): ?string
  435.     {
  436.         return $this->holderZipcode;
  437.     }
  438.     public function setHolderZipcode(?string $holderZipcode): self
  439.     {
  440.         $this->holderZipcode $holderZipcode;
  441.         return $this;
  442.     }
  443.     public function setHolderAddress(?string $holderAddress): void
  444.     {
  445.         $this->holderAddress $holderAddress;
  446.     }
  447.     public function getHolderAddress(): ?string
  448.     {
  449.         return $this->holderAddress;
  450.     }
  451.     public function getHolderComplement(): ?string
  452.     {
  453.         return $this->holderComplement;
  454.     }
  455.     public function setHolderComplement(?string $holderComplement): self
  456.     {
  457.         $this->holderComplement $holderComplement;
  458.         return $this;
  459.     }
  460.     public function getHolderNeighborhood(): ?string
  461.     {
  462.         return $this->holderNeighborhood;
  463.     }
  464.     public function setHolderNeighborhood(?string $holderNeighborhood): self
  465.     {
  466.         $this->holderNeighborhood $holderNeighborhood;
  467.         return $this;
  468.     }
  469.     public function getHolderCity(): ?string
  470.     {
  471.         return $this->holderCity;
  472.     }
  473.     public function setHolderCity(?string $holderCity): self
  474.     {
  475.         $this->holderCity $holderCity;
  476.         return $this;
  477.     }
  478.     public function getHolderState(): ?string
  479.     {
  480.         return $this->holderState;
  481.     }
  482.     public function setHolderState(?string $holderState): self
  483.     {
  484.         $this->holderState $holderState;
  485.         return $this;
  486.     }
  487.     public function setHolderTaxID(?string $holderTaxID): void
  488.     {
  489.         $this->holderTaxID $holderTaxID;
  490.     }
  491.     public function getHolderTaxID(): ?string
  492.     {
  493.         return $this->holderTaxID;
  494.     }
  495.     public function setHolderTaxIDType(?string $holderTaxIDType): void
  496.     {
  497.         $this->holderTaxIDType $holderTaxIDType;
  498.     }
  499.     public function getHolderTaxIDType(): ?string
  500.     {
  501.         return $this->holderTaxIDType;
  502.     }
  503.     /**
  504.      * @param float|null $eligibleQuantity
  505.      */
  506.     public function setEligibleQuantity($eligibleQuantity): void
  507.     {
  508.         $this->eligibleQuantity $eligibleQuantity;
  509.     }
  510.     public function getEligibleQuantity(): ?float
  511.     {
  512.         return $this->eligibleQuantity;
  513.     }
  514.     /**
  515.      * @param float|null $interestRate
  516.      */
  517.     public function setInterestRate($interestRate): void
  518.     {
  519.         $this->interestRate $interestRate;
  520.     }
  521.     public function getInterestRate(): ?float
  522.     {
  523.         return $this->interestRate;
  524.     }
  525.     /**
  526.      * @param float|null $insurancePremium
  527.      */
  528.     public function setInsurancePremium($insurancePremium): void
  529.     {
  530.         $this->insurancePremium $insurancePremium;
  531.     }
  532.     public function getInsurancePremium(): ?float
  533.     {
  534.         return $this->insurancePremium;
  535.     }
  536.     /**
  537.      * @param float|null $interestFee
  538.      */
  539.     public function setInterestFee($interestFee): void
  540.     {
  541.         $this->interestFee $interestFee;
  542.     }
  543.     public function getInterestFee(): ?float
  544.     {
  545.         return $this->interestFee;
  546.     }
  547.     /**
  548.      * @param float|null $commission
  549.      */
  550.     public function setCommission($commission): void
  551.     {
  552.         $this->commission $commission;
  553.     }
  554.     public function getCommission(): ?float
  555.     {
  556.         return $this->commission;
  557.     }
  558.     /**
  559.      * @param bool|null $hasParentOrganization
  560.      */
  561.     public function setHasParentOrganization($hasParentOrganization): void
  562.     {
  563.         $this->hasParentOrganization $hasParentOrganization;
  564.     }
  565.     public function getHasParentOrganization(): ?bool
  566.     {
  567.         return $this->hasParentOrganization;
  568.     }
  569.     /**
  570.      * @param string|null $status
  571.      */
  572.     public function setStatus($status): void
  573.     {
  574.         $this->status $status;
  575.     }
  576.     public function getStatus(): ?string
  577.     {
  578.         return $this->status;
  579.     }
  580.     /**
  581.      * @return Collection|Endorsement[]
  582.      */
  583.     public function getEndorsements(): Collection
  584.     {
  585.         return $this->endorsements;
  586.     }
  587.     public function addEndorsement(Endorsement $endorsement): self
  588.     {
  589.         if (!$this->endorsements->contains($endorsement)) {
  590.             $this->endorsements[] = $endorsement;
  591.             $endorsement->setPolicy($this);
  592.         }
  593.         return $this;
  594.     }
  595.     public function removeEndorsement(Endorsement $endorsement): self
  596.     {
  597.         if ($this->endorsements->removeElement($endorsement)) {
  598.             // set the owning side to null (unless already changed)
  599.             if ($endorsement->getPolicy() === $this) {
  600.                 $endorsement->setPolicy(null);
  601.             }
  602.         }
  603.         return $this;
  604.     }
  605.     /**
  606.      * @return Collection|PolicyInsurer[]
  607.      */
  608.     public function getInsurers(): Collection
  609.     {
  610.         return $this->insurers;
  611.     }
  612.     public function addInsurer(PolicyInsurer $insurer): self
  613.     {
  614.         if (!$this->insurers->contains($insurer)) {
  615.             $this->insurers[] = $insurer;
  616.         }
  617.         return $this;
  618.     }
  619.     public function removeInsurer(PolicyInsurer $insurer): self
  620.     {
  621.         $this->insurers->removeElement($insurer);
  622.         return $this;
  623.     }
  624.     public function getInsurerLeader(): ?Insurer
  625.     {
  626.         return $this->insurerLeader;
  627.     }
  628.     public function setInsurerLeader(?Insurer $insurerLeader): self
  629.     {
  630.         $this->insurerLeader $insurerLeader;
  631.         return $this;
  632.     }
  633.         public function getInsurerLeaderName(): ?string
  634.         {
  635.             $insurerLeader $this->getInsurerLeader();
  636.             if ($insurerLeader !== null) {
  637.                 return $insurerLeader->getName();
  638.             }
  639.             return null;
  640.         }
  641.     public function getInsurerLeaderTaxID(): ?string
  642.     {
  643.         return $this->getInsurerLeader()?->getTaxID();
  644.     }
  645.     /**
  646.      * @return Collection|PolicyUpload[]
  647.      */
  648.     public function getUploads(): Collection
  649.     {
  650.         return $this->uploads;
  651.     }
  652.     public function addUpload(PolicyUpload $upload): self
  653.     {
  654.         if (!$this->uploads->contains($upload)) {
  655.             $this->uploads[] = $upload;
  656.             $upload->setPolicy($this);
  657.         }
  658.         return $this;
  659.     }
  660.     public function removeUpload(PolicyUpload $upload): self
  661.     {
  662.         if ($this->uploads->removeElement($upload)) {
  663.             // set the owning side to null (unless already changed)
  664.             if ($upload->getPolicy() === $this) {
  665.                 $upload->setPolicy(null);
  666.             }
  667.         }
  668.         return $this;
  669.     }
  670.     public function getInsured(): ?Insured
  671.     {
  672.         return $this->insured;
  673.     }
  674.     public function setInsured(?Insured $insured): self
  675.     {
  676.         $this->insured $insured;
  677.         return $this;
  678.     }  
  679.     public function getInsuredTaxID(): ?string
  680.     {
  681.         return $this->getInsured()->getTaxID();
  682.     }
  683.     public function getDemand(): ?Demand
  684.     {
  685.         return $this->demand;
  686.     }
  687.     public function setDemand(?Demand $demand): self
  688.     {
  689.         // unset the owning side of the relation if necessary
  690.         if (null === $demand && null !== $this->demand) {
  691.             $this->demand->setPolicy(null);
  692.         }
  693.         // set the owning side of the relation if necessary
  694.         if (null !== $demand && $demand->getPolicy() !== $this) {
  695.             $demand->setPolicy($this);
  696.         }
  697.         $this->demand $demand;
  698.         return $this;
  699.     }
  700.     public function getDemandEndTime(): ?\DateTimeInterface
  701.     {
  702.         $demand $this->getDemand();
  703.         if ($demand !== null) {
  704.             return $demand->getEndTime();
  705.         }
  706.         return null;
  707.     }    
  708.     public function getPaymentMethod(): ?string
  709.     {
  710.         return $this->paymentMethod;
  711.     }
  712.     public function setPaymentMethod(?string $paymentMethod): self
  713.     {
  714.         $this->paymentMethod $paymentMethod;
  715.         return $this;
  716.     }
  717.     public function getObservations(): ?string
  718.     {
  719.         return $this->observations;
  720.     }
  721.     public function setObservations(?string $observations): self
  722.     {
  723.         $this->observations $observations;
  724.         return $this;
  725.     }
  726. }