<?php
/**
* Created by PhpStorm.
* User: apple
* Date: 29/03/19
* Time: 2:43 PM
*/
namespace App\AppBundle\MainBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use JsonSerializable;
/**
* AddOns
*
* @ORM\Entity
* @ORM\Table(name="wp_accessibility_cities")
* @ORM\HasLifecycleCallbacks()
*/
class WP_Accessibility_Cities implements JsonSerializable
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", nullable=false)
* @Assert\NotBlank()
*/
private $name;
/**
* @ORM\Column(type="string", nullable=false)
* @Assert\NotBlank()
*/
private $original_name;
/**
* @ORM\Column(type="string", nullable=false)
* @Assert\NotBlank()
*/
private $city_code;
/**
* @ORM\Column(type="boolean", nullable=false)
* @Assert\NotBlank()
*/
private $active;
/**
* Many features have one product. This is the owning side.
* @ORM\ManyToOne(targetEntity="WP_Accessibility_States", inversedBy="wp_accessibility_cities")
* @ORM\JoinColumn(name="wp_accessibility_state_id", referencedColumnName="id")
*/
private $wp_accessibility_states;
/**
* Many features have one product. This is the owning side.
* @ORM\ManyToOne(targetEntity="WP_Accessibility_Country", inversedBy="wp_accessibility_cities")
* @ORM\JoinColumn(name="wp_accessibility_country_id", referencedColumnName="id")
*/
private $wp_accessibility_country;
/**
* @ORM\Column(type="integer", nullable=true)
* @Assert\NotBlank()
*/
private $web_city_id;
/**
* @ORM\Column(type="integer", nullable=true)
* @Assert\NotBlank()
*/
private $service_city_id;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @return mixed
*/
public function getName()
{
return $this->name;
}
/**
* @param mixed $name
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @return mixed
*/
public function getOriginalName()
{
return $this->original_name;
}
/**
* @param mixed $original_name
*/
public function setOriginalName($original_name): void
{
$this->original_name = $original_name;
}
/**
* @return mixed
*/
public function getActive()
{
return $this->active;
}
/**
* @param mixed $active
*/
public function setActive($active)
{
$this->active = $active;
}
/**
* @return mixed
*/
public function getCityCode()
{
return $this->city_code;
}
/**
* @param mixed $city_code
*/
public function setCityCode($city_code)
{
$this->city_code = $city_code;
}
/**
* @return mixed
*/
public function getWpAccessibilityStates()
{
return $this->wp_accessibility_states;
}
/**
* @param mixed $wp_accessibility_states
*/
public function setWpAccessibilityStates($wp_accessibility_states)
{
$this->wp_accessibility_states = $wp_accessibility_states;
}
/**
* @return mixed
*/
public function getWpAccessibilityCountry()
{
return $this->wp_accessibility_country;
}
/**
* @param mixed $wp_accessibility_country
*/
public function setWpAccessibilityCountry($wp_accessibility_country)
{
$this->wp_accessibility_country = $wp_accessibility_country;
}
/**
* @return mixed
*/
public function getWebCityId()
{
return $this->web_city_id;
}
/**
* @param mixed $web_city_id
*/
public function setWebCityId($web_city_id): void
{
$this->web_city_id = $web_city_id;
}
/**
* @return mixed
*/
public function getServiceCityId()
{
return $this->service_city_id;
}
/**
* @param mixed $service_city_id
*/
public function setServiceCityId($service_city_id): void
{
$this->service_city_id = $service_city_id;
}
public function jsonSerialize()
{
return array(
'id' => $this->id,
'active' => $this->active,
'name' => $this->name,
'web_city_id' => $this->web_city_id,
'original_name' => $this->original_name,
'city_code' => $this->city_code,
'service_city_id' => $this->service_city_id
);
}
/**
* @var string $created
*
* @ORM\Column(name="created_at", type="string", nullable=false)
*/
protected $createdAt;
/**
* @var string $updated
*
* @ORM\Column(name="updated_at", type="string", nullable=false)
*/
protected $updatedAt;
public function getCreatedAt()
{
return $this->createdAt;
}
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt()
{
return $this->updatedAt;
}
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* @ORM\PrePersist
* @ORM\PreUpdate
*/
public function updatedTimestamps()
{
$this->setUpdatedAt(round(microtime(true) * 1000));
if ($this->getCreatedAt() === null) {
$this->setCreatedAt(round(microtime(true) * 1000));
}
}
public function __construct() {
$this->setCreatedAt(round(microtime(true) * 1000));
}
}