<?php
namespace App\Entity\Application;
use App\Repository\Application\InformationRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Symfony\Component\Validator\Constraints as Assert;
use App\Entity\User;
use JMS\Serializer\Annotation as Serializer;
use App\Entity\Behaviors\TranslatableTrait;
use Knp\DoctrineBehaviors\Contract\Entity\TranslatableInterface;
/**
*
* @ORM\Table(name="app_information")
* @ORM\EntityListeners({"App\Listener\EntityListener"})
* @ORM\Entity(repositoryClass=InformationRepository::class)
* @Vich\Uploadable()
*/
class Information implements TranslatableInterface
{
use TranslatableTrait;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @Serializer\Groups({"api"})
* @Serializer\SerializedName("name")
* @ORM\Column(type="string", length=190)
*/
private $name;
/**
* @Serializer\Groups({"api"})
* @Serializer\SerializedName("secondName")
* @ORM\Column(type="string", length=190)
*/
private $secondName;
/**
* @Serializer\Groups({"api"})
* @Serializer\SerializedName("phone")
* @ORM\Column(type="string", length=100)
*/
private $phone;
/**
* @Serializer\Groups({"api"})
* @Serializer\SerializedName("email")
* @ORM\Column(type="string", length=150)
*/
private $email;
/**
* @Serializer\Groups({"api"})
* @Serializer\SerializedName("gps")
* @ORM\Column(type="string", length=150)
*/
private $gps;
/**
* @Serializer\Groups({"api"})
* @Serializer\SerializedName("lat")
* @ORM\Column(type="float")
*/
private $lat;
/**
* @Serializer\Groups({"api"})
* @Serializer\SerializedName("lng")
* @ORM\Column(type="float")
*/
private $lng;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $b2b;
/**
* @Serializer\Groups({"api"})
* @Serializer\SerializedName("address")
* @ORM\Column(type="string")
*/
private $address;
/**
* @Serializer\Groups({"api"})
* @Serializer\SerializedName("zip")
* @ORM\Column(type="string")
*/
private $zip;
/**
* @Vich\UploadableField(mapping="store_logo", fileNameProperty="logo")
* @Assert\Image(mimeTypes={"image/png", "image/jpeg", "image/jpg", "image/gif"})
* @var File|null
*/
private $logoFile;
/**
* @Serializer\Groups({"api"})
* @Serializer\SerializedName("logo")
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $logo;
/**
* @ORM\Column(type="datetime")
*/
private $createts;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\User")
* @ORM\JoinColumn(nullable=true)
*/
private $createUser;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $editts;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\User")
*/
private $editUser;
/**
* @Vich\UploadableField(mapping="information_image", fileNameProperty="image1")
* @Assert\Image(mimeTypes={"image/png", "image/jpeg", "image/jpg", "image/gif"})
* @var File|null
*/
private $image1File;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $image1;
/**
* @Vich\UploadableField(mapping="information_image", fileNameProperty="image2")
* @Assert\Image(mimeTypes={"image/png", "image/jpeg", "image/jpg", "image/gif"})
* @var File|null
*/
private $image2File;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $image2;
/**
* @Vich\UploadableField(mapping="information_image", fileNameProperty="image3")
* @Assert\Image(mimeTypes={"image/png", "image/jpeg", "image/jpg", "image/gif"})
* @var File|null
*/
private $image3File;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $image3;
/**
* @Vich\UploadableField(mapping="information_image", fileNameProperty="image4")
* @Assert\Image(mimeTypes={"image/png", "image/jpeg", "image/jpg", "image/gif"})
* @var File|null
*/
private $image4File;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $image4;
/**
* @Vich\UploadableField(mapping="information_image", fileNameProperty="image5")
* @Assert\Image(mimeTypes={"image/png", "image/jpeg", "image/jpg", "image/gif"})
* @var File|null
*/
private $image5File;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $image5;
/**
* @Vich\UploadableField(mapping="information_image", fileNameProperty="image6")
* @Assert\Image(mimeTypes={"image/png", "image/jpeg", "image/jpg", "image/gif"})
* @var File|null
*/
private $image6File;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $image6;
/**
* @Serializer\Groups({"api"})
* @Serializer\SerializedName("images")
*/
private $images;
/**
* @ORM\Column(type="time", nullable=true)
*/
private $openFrom;
/**
* @ORM\Column(type="time", nullable=true)
*/
private $openTo;
/**
* @ORM\Column(type="array", nullable=true)
*/
private $opening;
/**
* @Serializer\VirtualProperty()
* @Serializer\Groups({"api"})
* @Serializer\Inline()
*/
public function getVirtualTranslation()
{
return $this->translate();
}
/**
* @Serializer\VirtualProperty()
* @Serializer\Groups({"api"})
* @Serializer\SerializedName("openHours")
*/
public function getVirtualOpenHoursToday()
{
$out = [];
foreach ($this->getOpening() as $item) {
$out[]=implode(' - ',$item);
}
return $out;
}
public function __call($method, $arguments)
{
$ret = $this->proxyCurrentLocaleTranslation($method, $arguments);
if(empty($ret)) {
$ret = call_user_func_array( [ $this->translate( \Locale::getDefault() ), $method ], $arguments );
}
return $ret;
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getPhone(): ?string
{
return $this->phone;
}
public function setPhone(string $phone): self
{
$this->phone = $phone;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
public function getGps(): ?string
{
return $this->gps;
}
public function setGps(string $gps): self
{
$this->gps = $gps;
return $this;
}
public function getAddress(): ?string
{
return $this->address;
}
public function setAddress(string $address): self
{
$this->address = $address;
return $this;
}
public function getLogo(): ?string
{
return $this->logo;
}
public function setLogo(?string $logo): self
{
$this->logo = $logo;
return $this;
}
public function getCreatets(): ?\DateTimeInterface
{
return $this->createts;
}
public function setCreatets(\DateTimeInterface $createts): self
{
$this->createts = $createts;
return $this;
}
public function getCreateUser(): ?User
{
return $this->createUser;
}
public function setCreateUser(?User $createUser): self
{
$this->createUser = $createUser;
return $this;
}
public function getEditts(): ?\DateTimeInterface
{
return $this->editts;
}
public function setEditts(?\DateTimeInterface $editts): self
{
$this->editts = $editts;
return $this;
}
public function getEditUser(): ?User
{
return $this->editUser;
}
public function setEditUser(?User $editUser): self
{
$this->editUser = $editUser;
return $this;
}
/**
* Get ImageFile
*
* @return null|File
*/
public function getLogoFile(): ?File
{
return $this->logoFile;
}
/**
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $logoFile
*/
public function setLogoFile(?File $logoFile = null): void
{
$this->logoFile = $logoFile;
if (null !== $logoFile) {
$this->editts = new \DateTime();
}
}
/**
* Get Image1File
*
* @return null|File
*/
public function getImage1File(): ?File
{
return $this->image1File;
}
/**
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $image1File
*/
public function setImage1File(?File $image1File = null): void
{
$this->image1File = $image1File;
if (null !== $image1File) {
$this->editts = new \DateTime();
}
}
/**
* Get Image1
*
* @return mixed
*/
public function getImage1()
{
return $this->image1;
}
/**
* Set Image1
*
* @param mixed $image1
*/
public function setImage1( $image1 )
{
$this->image1 = $image1;
}
/**
* Get Image2File
*
* @return null|File
*/
public function getImage2File(): ?File
{
return $this->image2File;
}
/**
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $image2File
*/
public function setImage2File(?File $image2File = null): void
{
$this->image2File = $image2File;
if (null !== $image2File) {
$this->editts = new \DateTime();
}
}
/**
* Get Image2
*
* @return mixed
*/
public function getImage2()
{
return $this->image2;
}
/**
* Set Image2
*
* @param mixed $image2
*/
public function setImage2( $image2 )
{
$this->image2 = $image2;
}
/**
* Get Image3File
*
* @return null|File
*/
public function getImage3File(): ?File
{
return $this->image3File;
}
/**
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $image3File
*/
public function setImage3File(?File $image3File = null): void
{
$this->image3File = $image3File;
if (null !== $image3File) {
$this->editts = new \DateTime();
}
}
/**
* Get Image3
*
* @return mixed
*/
public function getImage3()
{
return $this->image3;
}
/**
* Set Image3
*
* @param mixed $image3
*/
public function setImage3( $image3 )
{
$this->image3 = $image3;
}
/**
* Get Image4File
*
* @return null|File
*/
public function getImage4File(): ?File
{
return $this->image4File;
}
/**
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $image4File
*/
public function setImage4File(?File $image4File = null): void
{
$this->image4File = $image4File;
if (null !== $image4File) {
$this->editts = new \DateTime();
}
}
/**
* Get Image4
*
* @return mixed
*/
public function getImage4()
{
return $this->image4;
}
/**
* Set Image4
*
* @param mixed $image4
*/
public function setImage4( $image4 )
{
$this->image4 = $image4;
}
/**
* Get Image5File
*
* @return null|File
*/
public function getImage5File(): ?File
{
return $this->image5File;
}
/**
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $image5File
*/
public function setImage5File(?File $image5File = null): void
{
$this->image5File = $image5File;
if (null !== $image5File) {
$this->editts = new \DateTime();
}
}
/**
* Get Image5
*
* @return mixed
*/
public function getImage5()
{
return $this->image5;
}
/**
* Set Image5
*
* @param mixed $image5
*/
public function setImage5( $image5 )
{
$this->image5 = $image5;
}
/**
* Get Image6File
*
* @return null|File
*/
public function getImage6File(): ?File
{
return $this->image6File;
}
/**
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $image6File
*/
public function setImage6File(?File $image6File = null): void
{
$this->image6File = $image6File;
if (null !== $image6File) {
$this->editts = new \DateTime();
}
}
/**
* Get Image6
*
* @return mixed
*/
public function getImage6()
{
return $this->image6;
}
/**
* Set Image6
*
* @param mixed $image6
*/
public function setImage6( $image6 )
{
$this->image6 = $image6;
}
/**
* Get Images
*
* @return mixed
*/
public function getImages()
{
return $this->images;
}
/**
* Set Images
*
* @param mixed $images
*/
public function setImages( $images )
{
$this->images = $images;
}
/**
* Get Lat
*
* @return mixed
*/
public function getLat()
{
return $this->lat;
}
/**
* Set Lat
*
* @param mixed $lat
*/
public function setLat( $lat )
{
$this->lat = $lat;
}
/**
* Get Lng
*
* @return mixed
*/
public function getLng()
{
return $this->lng;
}
/**
* Set Lng
*
* @param mixed $lng
*/
public function setLng( $lng )
{
$this->lng = $lng;
}
/**
* Get Zip
*
* @return mixed
*/
public function getZip()
{
return $this->zip;
}
/**
* Set Zip
*
* @param mixed $zip
*/
public function setZip( $zip )
{
$this->zip = $zip;
}
/**
* Get SecondName
*
* @return mixed
*/
public function getSecondName()
{
return $this->secondName;
}
/**
* Set SecondName
*
* @param mixed $secondName
*/
public function setSecondName( $secondName )
{
$this->secondName = $secondName;
}
/**
* @return mixed
*/
public function getOpenFrom()
{
return $this->openFrom;
}
/**
* @param mixed $openFrom
*/
public function setOpenFrom($openFrom): void
{
$this->openFrom = $openFrom;
}
/**
* @return mixed
*/
public function getOpenTo()
{
return $this->openTo;
}
/**
* @param mixed $openTo
*/
public function setOpenTo($openTo): void
{
$this->openTo = $openTo;
}
/**
* @return mixed
*/
public function getB2b()
{
return $this->b2b;
}
/**
* @param mixed $b2b
*/
public function setB2b($b2b): void
{
$this->b2b = $b2b;
}
/**
* @return mixed
*/
public function getOpening()
{
if($this->opening === null){
return [];
}
return $this->opening;
}
/**
* @param mixed $opening
*/
public function setOpening($opening): void
{
$this->opening = $opening;
}
}