Created
August 1, 2018 09:56
-
-
Save BerezhniyDmitro/13a0d83aa4bd46d07cf738b81be23cc9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Models\Page\ServicePage\Entity; | |
use App\Models\Page\Page; | |
use App\Models\Page\Seo; | |
use App\Models\Page\Sitemap; | |
use App\Models\Page\Social; | |
use Doctrine\ORM\Mapping as ORM; | |
use Doctrine\ORM\Mapping\OneToOne; | |
/** | |
* @ORM\Entity | |
* @ORM\Table(name="pages_new") | |
*/ | |
class ServicePage extends Page { | |
/** | |
* @var int тип страницы Регион\бизнес | |
*/ | |
const BUSINESS_PAGE_TYPE_ID = 3; | |
/** | |
* @var string корневой url страниц | |
*/ | |
const URL_ROOT_SEGMENT = 'services/'; | |
/** | |
* @ORM\Id | |
* @ORM\Column(type="integer", name="id") | |
* @ORM\GeneratedValue(strategy="AUTO") | |
*/ | |
protected $id; | |
/** | |
* @ORM\Column(type="string", name="title") | |
*/ | |
protected $title; | |
/** | |
* @ORM\Column(type="text", name="short_description") | |
*/ | |
private $shortDescription; | |
/** | |
* @ORM\Column(type="string", name="url") | |
*/ | |
protected $url; | |
/** | |
* @ORM\Column(type="boolean", name="is_visible") | |
*/ | |
private $isVisible = false; | |
/** | |
* @ORM\Column(type="integer", name="page_type_id") | |
*/ | |
private $type = self::BUSINESS_PAGE_TYPE_ID; | |
/** | |
* @OneToOne(targetEntity="ServicePageSitemap", inversedBy="page", cascade={"persist", "remove"}) | |
*/ | |
protected $sitemap; | |
// /** | |
// * @OneToOne(targetEntity="ServicePageSeo", mappedBy="page", cascade={"persist", "remove"}) | |
// */ | |
// protected $seo; | |
// | |
// /** | |
// * @OneToOne(targetEntity="ServicePageSocial", mappedBy="page", cascade={"persist", "remove"}) | |
// */ | |
// protected $social; | |
/** | |
* @param int $id | |
*/ | |
public function changeId($id) | |
{ | |
$this->id = $id; | |
} | |
/** | |
* @param string $title | |
*/ | |
public function changeTitle($title) | |
{ | |
$this->title = $title; | |
} | |
/** | |
* @param string $shortDescription | |
*/ | |
public function changeShortDescription($shortDescription) | |
{ | |
$this->shortDescription = $shortDescription; | |
} | |
/** | |
* @param string $url | |
*/ | |
public function changeUrl($url) | |
{ | |
$this->url = self::URL_ROOT_SEGMENT . $url; | |
} | |
/** | |
* @param boolean $isVisible | |
*/ | |
public function changeIsVisible($isVisible) | |
{ | |
$this->isVisible = $isVisible; | |
} | |
/** | |
* Метод конвертирует обьект в массив | |
* | |
* @return array | |
*/ | |
public function convert_to_array() | |
{ | |
return []; | |
} | |
/** | |
* @param Sitemap $sitemap | |
*/ | |
public function changeSitemap($sitemap) | |
{ | |
// $sitemap->changePage($this); | |
$this->sitemap = $sitemap; | |
} | |
// /** | |
// * @param Seo $seo | |
// */ | |
// public function changeSeo(Seo $seo) | |
// { | |
// $seo->changePage($this); | |
// $this->seo = $seo; | |
// } | |
// | |
// /** | |
// * @param Social $social | |
// */ | |
// public function changeSocial(Social $social) | |
// { | |
// $social->changePage($this); | |
// $this->social = $social; | |
// } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment