src/AppBundle/MainBundle/Entity/PS_Add_Spot_Pricing_Custom.php line 221

Open in your IDE?
  1. <?php
  2. /**
  3.  * Created by PhpStorm.
  4.  * User: apple
  5.  * Date: 29/03/19
  6.  * Time: 3:08 PM
  7.  */
  8. namespace App\AppBundle\MainBundle\Entity;
  9. use Doctrine\Common\Collections\ArrayCollection;
  10. use Doctrine\ORM\Mapping as ORM;
  11. use Symfony\Component\Validator\Constraints as Assert;
  12. use JsonSerializable;
  13. /**
  14.  * AddOns
  15.  *
  16.  * @ORM\Entity(repositoryClass="App\AppBundle\MainBundle\Repository\PS_Add_Spot_Pricing_CustomRepository")
  17.  * @ORM\Table(name="ps_add_spot_pricing_custom")
  18.  * @ORM\HasLifecycleCallbacks()
  19.  */
  20. class PS_Add_Spot_Pricing_Custom implements JsonSerializable
  21. {
  22.     /**
  23.      * @ORM\Column(type="integer")
  24.      * @ORM\Id
  25.      * @ORM\GeneratedValue(strategy="AUTO")
  26.      */
  27.     private $id;
  28.     /**
  29.      * @ORM\Column(type="boolean", nullable=true)
  30.      * @Assert\NotBlank()
  31.      */
  32.     private $is_default_rate;
  33.     /**
  34.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  35.      * @Assert\NotBlank()
  36.      */
  37.     private $default_rate;
  38.     /**
  39.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  40.      * @Assert\NotBlank()
  41.      */
  42.     private $daily_max;
  43.     /**
  44.      * One product has many features. This is the inverse side.
  45.      * @ORM\OneToMany(targetEntity="PS_Add_Spot_Pricing_Custom_Price", mappedBy="ps_add_spot_pricing_custom")
  46.      */
  47.     private $ps_add_spot_pricing_custom_prices;
  48.     /**
  49.      * @var PS_Add_Spot_Availability
  50.      * @ORM\OneToOne(targetEntity="PS_Add_Spot_Availability")
  51.      * @ORM\JoinColumn(name="ps_add_spot_availability_id", referencedColumnName="id")
  52.      */
  53.     private $ps_add_spot_availability;
  54.     /**
  55.      * Many features have one product. This is the owning side.
  56.      * @ORM\ManyToOne(targetEntity="PS_Add_Spot_Pricing", inversedBy="ps_add_spot_pricing_custom")
  57.      * @ORM\JoinColumn(name="ps_add_spot_pricing_id", referencedColumnName="id", onDelete="SET NULL")
  58.      */
  59.     private $ps_add_spot_pricing;
  60.     /**
  61.      * @return mixed
  62.      */
  63.     public function getId()
  64.     {
  65.         return $this->id;
  66.     }
  67.     /**
  68.      * @return mixed
  69.      */
  70.     public function getDefaultRate()
  71.     {
  72.         return $this->default_rate;
  73.     }
  74.     /**
  75.      * @param mixed $default_rate
  76.      */
  77.     public function setDefaultRate($default_rate)
  78.     {
  79.         $this->default_rate $default_rate;
  80.     }
  81.     /**
  82.      * @return mixed
  83.      */
  84.     public function getDailyMax()
  85.     {
  86.         return $this->daily_max;
  87.     }
  88.     /**
  89.      * @param mixed $daily_max
  90.      */
  91.     public function setDailyMax($daily_max)
  92.     {
  93.         $this->daily_max $daily_max;
  94.     }
  95.     /**
  96.      * Add subscriptionPlan
  97.      *
  98.      * @param PS_Add_Spot_Pricing_Custom_Price $customPrice
  99.      *
  100.      * @return PS_Add_Spot_Pricing_Custom
  101.      */
  102.     public function addPsAddSpotPricingCustomPrices(PS_Add_Spot_Pricing_Custom_Price $customPrice) {
  103.         if (!$this->ps_add_spot_pricing_custom_prices->contains($customPrice)) {
  104.             $this->ps_add_spot_pricing_custom_prices->add($customPrice);
  105.             $customPrice->setPsAddSpotPricingCustom($this);
  106.         }
  107.         return $this;
  108.     }
  109.     /**
  110.      * Remove PS_Add_Spot_Pricing_Custom_Price
  111.      *
  112.      * @param PS_Add_Spot_Pricing_Custom_Price $customPrice
  113.      */
  114.     public function removePsAddSpotPricingCustomPrices(PS_Add_Spot_Pricing_Custom_Price $customPrice) {
  115.         $this->ps_add_spot_pricing_custom_prices->removeElement($customPrice);
  116.     }
  117.     /**
  118.      * @return \Doctrine\Common\Collections\Collection
  119.      */
  120.     public function getPsAddSpotPricingCustomPrices()
  121.     {
  122.         return $this->ps_add_spot_pricing_custom_prices;
  123.     }
  124. //    /**
  125. //     * @param mixed $ps_add_spot_pricing_custom_prices
  126. //     */
  127. //    public function setPsAddSpotPricingCustomPrices($ps_add_spot_pricing_custom_prices)
  128. //    {
  129. //        $this->ps_add_spot_pricing_custom_prices = $ps_add_spot_pricing_custom_prices;
  130. //    }
  131.     /**
  132.      * @return PS_Add_Spot_Availability
  133.      */
  134.     public function getPsAddSpotAvailability()
  135.     {
  136.         return $this->ps_add_spot_availability;
  137.     }
  138.     /**
  139.      * @param mixed $ps_add_spot_availability
  140.      */
  141.     public function setPsAddSpotAvailability($ps_add_spot_availability)
  142.     {
  143.         $this->ps_add_spot_availability $ps_add_spot_availability;
  144.     }
  145.     /**
  146.      * @return mixed
  147.      */
  148.     public function getIsDefaultRate()
  149.     {
  150.         return $this->is_default_rate;
  151.     }
  152.     /**
  153.      * @param mixed $is_default_rate
  154.      */
  155.     public function setIsDefaultRate($is_default_rate)
  156.     {
  157.         $this->is_default_rate $is_default_rate;
  158.     }
  159.     /**
  160.      * @return mixed
  161.      */
  162.     public function getPsAddSpotPricing()
  163.     {
  164.         return $this->ps_add_spot_pricing;
  165.     }
  166.     /**
  167.      * @param mixed $ps_add_spot_pricing
  168.      */
  169.     public function setPsAddSpotPricing($ps_add_spot_pricing)
  170.     {
  171.         $this->ps_add_spot_pricing $ps_add_spot_pricing;
  172.     }
  173.     public function jsonSerialize()
  174.     {
  175.         return array(
  176.             'id' => $this->id,
  177.         );
  178.     }
  179.     /**
  180.      * @var string $created
  181.      *
  182.      * @ORM\Column(name="created_at", type="string", nullable=false)
  183.      */
  184.     protected $createdAt;
  185.     /**
  186.      * @var string $updated
  187.      *
  188.      * @ORM\Column(name="updated_at", type="string", nullable=false)
  189.      */
  190.     protected $updatedAt;
  191.     public function getCreatedAt()
  192.     {
  193.         return $this->createdAt;
  194.     }
  195.     public function setCreatedAt($createdAt)
  196.     {
  197.         $this->createdAt $createdAt;
  198.         return $this;
  199.     }
  200.     public function getUpdatedAt()
  201.     {
  202.         return $this->updatedAt;
  203.     }
  204.     public function setUpdatedAt($updatedAt)
  205.     {
  206.         $this->updatedAt $updatedAt;
  207.         return $this;
  208.     }
  209.     /**
  210.      * @ORM\PrePersist
  211.      * @ORM\PreUpdate
  212.      */
  213.     public function updatedTimestamps()
  214.     {
  215.         $this->setUpdatedAt(round(microtime(true) * 1000));
  216.         if ($this->getCreatedAt() === null) {
  217.             $this->setCreatedAt(round(microtime(true) * 1000));
  218.         }
  219.     }
  220.     public function __construct() {
  221.         $this->ps_add_spot_pricing_custom_prices = new ArrayCollection();
  222.         $this->setCreatedAt(round(microtime(true) * 1000));
  223.     }
  224. }