/
SiteTree.php
55 lines (45 loc) · 1.01 KB
/
SiteTree.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
namespace Concrete\Core\Entity\Site;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\InheritanceType("JOINED")
* @ORM\DiscriminatorColumn(name="treeType", type="string")
* @ORM\Table(
* name="SiteTreeTrees"
* )
*/
class SiteTree extends Tree
{
/**
* @ORM\OneToOne(targetEntity="\Concrete\Core\Entity\Site\Locale", inversedBy="tree")
* @ORM\JoinColumn(name="siteLocaleID", referencedColumnName="siteLocaleID")
**/
protected $locale;
/**
* @return Locale
*/
public function getLocale()
{
return $this->locale;
}
/**
* @param mixed $locale
*/
public function setLocale($locale)
{
$this->locale = $locale;
}
public function getSite()
{
return $this->getLocale()->getSite();
}
public function getSiteType()
{
return $this->getLocale()->getSite()->getType();
}
public function getDisplayName()
{
return $this->getLocale()->getSite()->getSiteName();
}
}