src/AppBundle/MainBundle/Entity/WP_Accessibility_Cities.php line 244

Open in your IDE?
  1. <?php
  2. /**
  3.  * Created by PhpStorm.
  4.  * User: apple
  5.  * Date: 29/03/19
  6.  * Time: 2:43 PM
  7.  */
  8. namespace App\AppBundle\MainBundle\Entity;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Symfony\Component\Validator\Constraints as Assert;
  11. use JsonSerializable;
  12. /**
  13.  * AddOns
  14.  *
  15.  * @ORM\Entity
  16.  * @ORM\Table(name="wp_accessibility_cities")
  17.  * @ORM\HasLifecycleCallbacks()
  18.  */
  19. class WP_Accessibility_Cities  implements JsonSerializable
  20. {
  21.     /**
  22.      * @ORM\Column(type="integer")
  23.      * @ORM\Id
  24.      * @ORM\GeneratedValue(strategy="AUTO")
  25.      */
  26.     private $id;
  27.     /**
  28.      * @ORM\Column(type="string", nullable=false)
  29.      * @Assert\NotBlank()
  30.      */
  31.     private $name;
  32.     /**
  33.      * @ORM\Column(type="string", nullable=false)
  34.      * @Assert\NotBlank()
  35.      */
  36.     private $original_name;
  37.     /**
  38.      * @ORM\Column(type="string", nullable=false)
  39.      * @Assert\NotBlank()
  40.      */
  41.     private $city_code;
  42.     /**
  43.      * @ORM\Column(type="boolean", nullable=false)
  44.      * @Assert\NotBlank()
  45.      */
  46.     private $active;
  47.     /**
  48.      * Many features have one product. This is the owning side.
  49.      * @ORM\ManyToOne(targetEntity="WP_Accessibility_States", inversedBy="wp_accessibility_cities")
  50.      * @ORM\JoinColumn(name="wp_accessibility_state_id", referencedColumnName="id")
  51.      */
  52.     private $wp_accessibility_states;
  53.     /**
  54.      * Many features have one product. This is the owning side.
  55.      * @ORM\ManyToOne(targetEntity="WP_Accessibility_Country", inversedBy="wp_accessibility_cities")
  56.      * @ORM\JoinColumn(name="wp_accessibility_country_id", referencedColumnName="id")
  57.      */
  58.     private $wp_accessibility_country;
  59.     /**
  60.      * @ORM\Column(type="integer", nullable=true)
  61.      * @Assert\NotBlank()
  62.      */
  63.     private $web_city_id;
  64.     /**
  65.      * @ORM\Column(type="integer", nullable=true)
  66.      * @Assert\NotBlank()
  67.      */
  68.     private $service_city_id;
  69.     /**
  70.      * @return mixed
  71.      */
  72.     public function getId()
  73.     {
  74.         return $this->id;
  75.     }
  76.     /**
  77.      * @return mixed
  78.      */
  79.     public function getName()
  80.     {
  81.         return $this->name;
  82.     }
  83.     /**
  84.      * @param mixed $name
  85.      */
  86.     public function setName($name)
  87.     {
  88.         $this->name $name;
  89.     }
  90.     /**
  91.      * @return mixed
  92.      */
  93.     public function getOriginalName()
  94.     {
  95.         return $this->original_name;
  96.     }
  97.     /**
  98.      * @param mixed $original_name
  99.      */
  100.     public function setOriginalName($original_name): void
  101.     {
  102.         $this->original_name $original_name;
  103.     }
  104.     /**
  105.      * @return mixed
  106.      */
  107.     public function getActive()
  108.     {
  109.         return $this->active;
  110.     }
  111.     /**
  112.      * @param mixed $active
  113.      */
  114.     public function setActive($active)
  115.     {
  116.         $this->active $active;
  117.     }
  118.     /**
  119.      * @return mixed
  120.      */
  121.     public function getCityCode()
  122.     {
  123.         return $this->city_code;
  124.     }
  125.     /**
  126.      * @param mixed $city_code
  127.      */
  128.     public function setCityCode($city_code)
  129.     {
  130.         $this->city_code $city_code;
  131.     }
  132.     /**
  133.      * @return mixed
  134.      */
  135.     public function getWpAccessibilityStates()
  136.     {
  137.         return $this->wp_accessibility_states;
  138.     }
  139.     /**
  140.      * @param mixed $wp_accessibility_states
  141.      */
  142.     public function setWpAccessibilityStates($wp_accessibility_states)
  143.     {
  144.         $this->wp_accessibility_states $wp_accessibility_states;
  145.     }
  146.     /**
  147.      * @return mixed
  148.      */
  149.     public function getWpAccessibilityCountry()
  150.     {
  151.         return $this->wp_accessibility_country;
  152.     }
  153.     /**
  154.      * @param mixed $wp_accessibility_country
  155.      */
  156.     public function setWpAccessibilityCountry($wp_accessibility_country)
  157.     {
  158.         $this->wp_accessibility_country $wp_accessibility_country;
  159.     }
  160.     /**
  161.      * @return mixed
  162.      */
  163.     public function getWebCityId()
  164.     {
  165.         return $this->web_city_id;
  166.     }
  167.     /**
  168.      * @param mixed $web_city_id
  169.      */
  170.     public function setWebCityId($web_city_id): void
  171.     {
  172.         $this->web_city_id $web_city_id;
  173.     }
  174.     /**
  175.      * @return mixed
  176.      */
  177.     public function getServiceCityId()
  178.     {
  179.         return $this->service_city_id;
  180.     }
  181.     /**
  182.      * @param mixed $service_city_id
  183.      */
  184.     public function setServiceCityId($service_city_id): void
  185.     {
  186.         $this->service_city_id $service_city_id;
  187.     }
  188.     public function jsonSerialize()
  189.     {
  190.         return array(
  191.             'id' => $this->id,
  192.             'active' => $this->active,
  193.             'name' => $this->name,
  194.             'web_city_id' => $this->web_city_id,
  195.             'original_name' => $this->original_name,
  196.             'city_code' => $this->city_code,
  197.             'service_city_id' => $this->service_city_id
  198.         );
  199.     }
  200.     /**
  201.      * @var string $created
  202.      *
  203.      * @ORM\Column(name="created_at", type="string", nullable=false)
  204.      */
  205.     protected $createdAt;
  206.     /**
  207.      * @var string $updated
  208.      *
  209.      * @ORM\Column(name="updated_at", type="string", nullable=false)
  210.      */
  211.     protected $updatedAt;
  212.     public function getCreatedAt()
  213.     {
  214.         return $this->createdAt;
  215.     }
  216.     public function setCreatedAt($createdAt)
  217.     {
  218.         $this->createdAt $createdAt;
  219.         return $this;
  220.     }
  221.     public function getUpdatedAt()
  222.     {
  223.         return $this->updatedAt;
  224.     }
  225.     public function setUpdatedAt($updatedAt)
  226.     {
  227.         $this->updatedAt $updatedAt;
  228.         return $this;
  229.     }
  230.     /**
  231.      * @ORM\PrePersist
  232.      * @ORM\PreUpdate
  233.      */
  234.     public function updatedTimestamps()
  235.     {
  236.         $this->setUpdatedAt(round(microtime(true) * 1000));
  237.         if ($this->getCreatedAt() === null) {
  238.             $this->setCreatedAt(round(microtime(true) * 1000));
  239.         }
  240.     }
  241.     public function __construct() {
  242.         $this->setCreatedAt(round(microtime(true) * 1000));
  243.     }
  244. }