- <?php
- /**
-  * Created by PhpStorm.
-  * User: yural
-  * Date: 21.12.2017
-  * Time: 23:36
-  */
- namespace Slivki\Entity;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\Common\Collections\Collection;
- use JsonSerializable;
- class BrandingBanner extends Entity implements JsonSerializable {
-     const FILE_PATH = "/ximage/";
-     protected $bannerID;
-     protected $title;
-     protected $url;
-     protected $rightSideUrl;
-     protected $bigImage;
-     protected $middleImage;
-     protected $smallImage;
-     protected $active;
-     protected $test;
-     protected $activeSince;
-     protected $activeTill;
-     protected $mobileImage;
-     protected $mobileBanner;
-     protected $mobileDivider;
-     protected $categories;
-     protected $forCategories;
-     protected $passThrough;
-     protected ?Collection $cities;
-     protected $cityID;
-     public function __construct() {
-         $this->categories = new ArrayCollection();
-         $this->cities = new ArrayCollection();
-     }
-     public function getBannerID() {
-         return $this->bannerID;
-     }
-     public function setBannerID($bannerID) {
-         $this->bannerID = $bannerID;
-     }
-     public function getTitle() {
-         return $this->title;
-     }
-     public function setTitle($title) {
-         $this->title = $title;
-     }
-     public function getUrl() {
-         return $this->url;
-     }
-     public function setUrl($url) {
-         $this->url = $url;
-     }
-     public function getRightSideUrl() {
-         return $this->rightSideUrl;
-     }
-     public function setRightSideUrl($rightSideUrl) {
-         $this->rightSideUrl = $rightSideUrl;
-     }
-     public function getBigImage() {
-         return $this->bigImage;
-     }
-     public function setBigImage($bigImage) {
-         $this->bigImage = $bigImage;
-     }
-     public function getMiddleImage() {
-         return $this->middleImage;
-     }
-     public function setMiddleImage($middleImage) {
-         $this->middleImage = $middleImage;
-     }
-     public function getSmallImage() {
-         return $this->smallImage;
-     }
-     public function setSmallImage($smallImage) {
-         $this->smallImage = $smallImage;
-     }
-     public function isActive() {
-         return $this->active;
-     }
-     public function setActive($active) {
-         $this->active = $active;
-     }
-     public function isForCategories() {
-         return $this->forCategories;
-     }
-     public function setForCategories($forCategories) {
-         $this->forCategories = $forCategories;
-     }
-     public function isPassThrough() {
-         return $this->passThrough;
-     }
-     public function setPassThrough($passThrough) {
-         $this->passThrough = $passThrough;
-     }
-     public function isTest() {
-         return $this->test;
-     }
-     public function setTest($test) {
-         $this->test = $test;
-     }
-     public function getActiveSince() {
-         return $this->activeSince;
-     }
-     public function setActiveSince($activeSince) {
-         $this->activeSince = $activeSince;
-     }
-     public function getActiveTill() {
-         return $this->activeTill;
-     }
-     public function setActiveTill($activeTill) {
-         $this->activeTill = $activeTill;
-     }
-     public function getMobileImage() {
-         return $this->mobileImage;
-     }
-     public function setMobileImage($mobileImage) {
-         $this->mobileImage = $mobileImage;
-     }
-     public function getMobileBanner() {
-         return $this->mobileBanner;
-     }
-     public function setMobileBanner($mobileBanner) {
-         $this->mobileBanner = $mobileBanner;
-     }
-     public function getMobileDivider() {
-         return $this->mobileDivider;
-     }
-     public function setMobileDivider($mobileDivider) {
-         $this->mobileDivider = $mobileDivider;
-     }
-     public function getCategories() {
-         return $this->categories;
-     }
-     public function addCategory(Category $category) {
-         if (!$this->categories->contains($category)) {
-             $this->categories->add($category);
-         }
-     }
-     public function removeCategory($category) {
-         $this->categories->removeElement($category);
-     }
-     public function addCity(City $city): void
-     {
-         if (!$this->cities->contains($city)) {
-             $this->cities->add($city);
-         }
-     }
-     public function removeCities(): void
-     {
-         $this->cities->clear();
-     }
-     public function getCityIds(): array
-     {
-         return array_map(
-             static fn (City $city): int => $city->getID(),
-             $this->cities->getValues(),
-         );
-     }
-     public function jsonSerialize(): array
-     {
-         return [
-             'ID' => $this->ID,
-             'title' => $this->title,
-             'bannerID' => $this->bannerID,
-             'active' => $this->active,
-             'test' => $this->test,
-             'url' => $this->url,
-             'cityIds' => $this->getCityIds(),
-             'rightSideUrl' => $this->rightSideUrl,
-             'bigImage' => $this->bigImage,
-             'middleImage' => $this->middleImage,
-             'smallImage' => $this->smallImage,
-             'activeSince' => $this->activeSince,
-             'activeTill' => $this->activeTill,
-             'mobileImage' => $this->mobileImage,
-             'mobileBanner' => $this->mobileBanner,
-             'mobileDivider' => $this->mobileDivider,
-             'forCategories' => $this->forCategories,
-         ];
-     }
- }
-