620 lines
11 KiB
PHP
620 lines
11 KiB
PHP
<?php
|
|
|
|
namespace Cadoles\PortalBundle\Entity;
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
|
|
|
/**
|
|
* Page
|
|
*
|
|
* @ORM\Entity
|
|
* @ORM\Table(name="page")
|
|
* @ORM\HasLifecycleCallbacks
|
|
* @ORM\Entity(repositoryClass="Cadoles\PortalBundle\Repository\PageRepository")
|
|
*/
|
|
class Page
|
|
{
|
|
/**
|
|
* @var integer
|
|
*
|
|
* @ORM\Column(name="id", type="integer")
|
|
* @ORM\Id
|
|
* @ORM\GeneratedValue(strategy="AUTO")
|
|
*/
|
|
private $id;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(name="name", type="string", length=100)
|
|
*/
|
|
private $name;
|
|
|
|
/**
|
|
* @var integer
|
|
*
|
|
* @ORM\Column(name="roworder", type="integer")
|
|
*/
|
|
private $roworder;
|
|
|
|
/**
|
|
* @var integer
|
|
*
|
|
* @ORM\Column(name="maxwidth", type="integer")
|
|
*/
|
|
private $maxwidth;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(name="fonticon", type="string", nullable=true)
|
|
*/
|
|
private $fonticon;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(name="url", type="text", nullable=true)
|
|
*/
|
|
private $url;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(name="html", type="text", nullable=true)
|
|
*/
|
|
private $html;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(name="template", type="array", nullable=true)
|
|
*/
|
|
private $template;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(name="parentfor", type="string", nullable=true)
|
|
*/
|
|
protected $parentfor;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(name="roles", type="array", nullable=true)
|
|
*/
|
|
private $roles;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="Pagecategory", inversedBy="pages")
|
|
*/
|
|
private $pagecategory;
|
|
|
|
/**
|
|
* @ORM\ManyToMany(targetEntity="Cadoles\CoreBundle\Entity\Group", inversedBy="pages", cascade={"persist"})
|
|
* @ORM\JoinTable(name="pagegroupe",
|
|
* joinColumns={@ORM\JoinColumn(name="page", referencedColumnName="id")},
|
|
* inverseJoinColumns={@ORM\JoinColumn(name="groupe", referencedColumnName="id")}
|
|
* )
|
|
*/
|
|
protected $groups;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="Cadoles\CoreBundle\Entity\User", inversedBy="pages")
|
|
* @ORM\JoinColumn(nullable=true)
|
|
*/
|
|
private $user;
|
|
|
|
/**
|
|
* @var ArrayCollection $pagewidgets
|
|
* @var Pagewidget
|
|
*
|
|
* @ORM\OneToMany(targetEntity="Pagewidget", mappedBy="page", cascade={"persist"}, orphanRemoval=true)
|
|
* @ORM\OrderBy({"loc" = "ASC", "roworder" = "ASC"})
|
|
*/
|
|
private $pagewidgets;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="Page", inversedBy="pages")
|
|
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
|
|
*/
|
|
private $page;
|
|
|
|
/**
|
|
* @var ArrayCollection $pages
|
|
* @var Page
|
|
*
|
|
* @ORM\OneToMany(targetEntity="Page", mappedBy="page", cascade={"persist"}, orphanRemoval=false)
|
|
*/
|
|
private $pages;
|
|
|
|
/**
|
|
* @var ArrayCollection $templategroups
|
|
* @var Group
|
|
*
|
|
* @ORM\OneToMany(targetEntity="Cadoles\CoreBundle\Entity\Group", mappedBy="pagetemplate", cascade={"persist"}, orphanRemoval=false)
|
|
*/
|
|
private $templategroups;
|
|
|
|
|
|
|
|
/* champs calculé non stocké en base */
|
|
private $canupdate;
|
|
public function getCanupdate()
|
|
{
|
|
return $this->canupdate;
|
|
}
|
|
public function setCanupdate($canupdate)
|
|
{
|
|
$this->canupdate = $canupdate;
|
|
return $this;
|
|
}
|
|
|
|
/* champs calculé non stocké en base */
|
|
private $counterread;
|
|
public function getCounterRead()
|
|
{
|
|
return $this->counterread;
|
|
}
|
|
public function setCounterRead($counterread)
|
|
{
|
|
$this->counterread = $counterread;
|
|
return $this;
|
|
}
|
|
|
|
// A garder pour forcer l'id en init
|
|
public function setId($id)
|
|
{
|
|
$this->id = $id;
|
|
return $this;
|
|
}
|
|
|
|
|
|
/**
|
|
* Constructor
|
|
*/
|
|
public function __construct()
|
|
{
|
|
$this->groups = new \Doctrine\Common\Collections\ArrayCollection();
|
|
$this->pagewidgets = new \Doctrine\Common\Collections\ArrayCollection();
|
|
$this->pages = new \Doctrine\Common\Collections\ArrayCollection();
|
|
}
|
|
|
|
/**
|
|
* Get id
|
|
*
|
|
* @return integer
|
|
*/
|
|
public function getId()
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
/**
|
|
* Set name
|
|
*
|
|
* @param string $name
|
|
*
|
|
* @return Page
|
|
*/
|
|
public function setName($name)
|
|
{
|
|
$this->name = $name;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get name
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getName()
|
|
{
|
|
return $this->name;
|
|
}
|
|
|
|
/**
|
|
* Set roworder
|
|
*
|
|
* @param integer $roworder
|
|
*
|
|
* @return Page
|
|
*/
|
|
public function setRoworder($roworder)
|
|
{
|
|
$this->roworder = $roworder;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get roworder
|
|
*
|
|
* @return integer
|
|
*/
|
|
public function getRoworder()
|
|
{
|
|
return $this->roworder;
|
|
}
|
|
|
|
/**
|
|
* Set maxwidth
|
|
*
|
|
* @param integer $maxwidth
|
|
*
|
|
* @return Page
|
|
*/
|
|
public function setMaxwidth($maxwidth)
|
|
{
|
|
$this->maxwidth = $maxwidth;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get maxwidth
|
|
*
|
|
* @return integer
|
|
*/
|
|
public function getMaxwidth()
|
|
{
|
|
return $this->maxwidth;
|
|
}
|
|
|
|
/**
|
|
* Set url
|
|
*
|
|
* @param string $url
|
|
*
|
|
* @return Page
|
|
*/
|
|
public function setUrl($url)
|
|
{
|
|
$this->url = $url;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get url
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getUrl()
|
|
{
|
|
return $this->url;
|
|
}
|
|
|
|
/**
|
|
* Set html
|
|
*
|
|
* @param string $html
|
|
*
|
|
* @return Page
|
|
*/
|
|
public function setHtml($html)
|
|
{
|
|
$this->html = $html;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get html
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getHtml()
|
|
{
|
|
return $this->html;
|
|
}
|
|
|
|
/**
|
|
* Set template
|
|
*
|
|
* @param array $template
|
|
*
|
|
* @return Page
|
|
*/
|
|
public function setTemplate($template)
|
|
{
|
|
$this->template = $template;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get template
|
|
*
|
|
* @return array
|
|
*/
|
|
public function getTemplate()
|
|
{
|
|
return $this->template;
|
|
}
|
|
|
|
/**
|
|
* Set parentfor
|
|
*
|
|
* @param string $parentfor
|
|
*
|
|
* @return Page
|
|
*/
|
|
public function setParentfor($parentfor)
|
|
{
|
|
$this->parentfor = $parentfor;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get parentfor
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getParentfor()
|
|
{
|
|
return $this->parentfor;
|
|
}
|
|
|
|
/**
|
|
* Set roles
|
|
*
|
|
* @param array $roles
|
|
*
|
|
* @return Page
|
|
*/
|
|
public function setRoles($roles)
|
|
{
|
|
$this->roles = $roles;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get roles
|
|
*
|
|
* @return array
|
|
*/
|
|
public function getRoles()
|
|
{
|
|
return $this->roles;
|
|
}
|
|
|
|
/**
|
|
* Set pagecategory
|
|
*
|
|
* @param \Cadoles\PortalBundle\Entity\Pagecategory $pagecategory
|
|
*
|
|
* @return Page
|
|
*/
|
|
public function setPagecategory(\Cadoles\PortalBundle\Entity\Pagecategory $pagecategory = null)
|
|
{
|
|
$this->pagecategory = $pagecategory;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get pagecategory
|
|
*
|
|
* @return \Cadoles\PortalBundle\Entity\Pagecategory
|
|
*/
|
|
public function getPagecategory()
|
|
{
|
|
return $this->pagecategory;
|
|
}
|
|
|
|
/**
|
|
* Add group
|
|
*
|
|
* @param \Cadoles\CoreBundle\Entity\Group $group
|
|
*
|
|
* @return Page
|
|
*/
|
|
public function addGroup(\Cadoles\CoreBundle\Entity\Group $group)
|
|
{
|
|
$this->groups[] = $group;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Remove group
|
|
*
|
|
* @param \Cadoles\CoreBundle\Entity\Group $group
|
|
*/
|
|
public function removeGroup(\Cadoles\CoreBundle\Entity\Group $group)
|
|
{
|
|
$this->groups->removeElement($group);
|
|
}
|
|
|
|
/**
|
|
* Get groups
|
|
*
|
|
* @return \Doctrine\Common\Collections\Collection
|
|
*/
|
|
public function getGroups()
|
|
{
|
|
return $this->groups;
|
|
}
|
|
|
|
/**
|
|
* Set user
|
|
*
|
|
* @param \Cadoles\CoreBundle\Entity\User $user
|
|
*
|
|
* @return Page
|
|
*/
|
|
public function setUser(\Cadoles\CoreBundle\Entity\User $user = null)
|
|
{
|
|
$this->user = $user;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get user
|
|
*
|
|
* @return \Cadoles\CoreBundle\Entity\User
|
|
*/
|
|
public function getUser()
|
|
{
|
|
return $this->user;
|
|
}
|
|
|
|
/**
|
|
* Add pagewidget
|
|
*
|
|
* @param \Cadoles\PortalBundle\Entity\Pagewidget $pagewidget
|
|
*
|
|
* @return Page
|
|
*/
|
|
public function addPagewidget(\Cadoles\PortalBundle\Entity\Pagewidget $pagewidget)
|
|
{
|
|
$this->pagewidgets[] = $pagewidget;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Remove pagewidget
|
|
*
|
|
* @param \Cadoles\PortalBundle\Entity\Pagewidget $pagewidget
|
|
*/
|
|
public function removePagewidget(\Cadoles\PortalBundle\Entity\Pagewidget $pagewidget)
|
|
{
|
|
$this->pagewidgets->removeElement($pagewidget);
|
|
}
|
|
|
|
/**
|
|
* Get pagewidgets
|
|
*
|
|
* @return \Doctrine\Common\Collections\Collection
|
|
*/
|
|
public function getPagewidgets()
|
|
{
|
|
return $this->pagewidgets;
|
|
}
|
|
|
|
/**
|
|
* Set page
|
|
*
|
|
* @param \Cadoles\PortalBundle\Entity\Page $page
|
|
*
|
|
* @return Page
|
|
*/
|
|
public function setPage(\Cadoles\PortalBundle\Entity\Page $page = null)
|
|
{
|
|
$this->page = $page;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get page
|
|
*
|
|
* @return \Cadoles\PortalBundle\Entity\Page
|
|
*/
|
|
public function getPage()
|
|
{
|
|
return $this->page;
|
|
}
|
|
|
|
/**
|
|
* Add page
|
|
*
|
|
* @param \Cadoles\PortalBundle\Entity\Page $page
|
|
*
|
|
* @return Page
|
|
*/
|
|
public function addPage(\Cadoles\PortalBundle\Entity\Page $page)
|
|
{
|
|
$this->pages[] = $page;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Remove page
|
|
*
|
|
* @param \Cadoles\PortalBundle\Entity\Page $page
|
|
*/
|
|
public function removePage(\Cadoles\PortalBundle\Entity\Page $page)
|
|
{
|
|
$this->pages->removeElement($page);
|
|
}
|
|
|
|
/**
|
|
* Get pages
|
|
*
|
|
* @return \Doctrine\Common\Collections\Collection
|
|
*/
|
|
public function getPages()
|
|
{
|
|
return $this->pages;
|
|
}
|
|
|
|
/**
|
|
* Add templategroup
|
|
*
|
|
* @param \Cadoles\CoreBundle\Entity\Group $templategroup
|
|
*
|
|
* @return Page
|
|
*/
|
|
public function addTemplategroup(\Cadoles\CoreBundle\Entity\Group $templategroup)
|
|
{
|
|
$this->templategroups[] = $templategroup;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Remove templategroup
|
|
*
|
|
* @param \Cadoles\CoreBundle\Entity\Group $templategroup
|
|
*/
|
|
public function removeTemplategroup(\Cadoles\CoreBundle\Entity\Group $templategroup)
|
|
{
|
|
$this->templategroups->removeElement($templategroup);
|
|
}
|
|
|
|
/**
|
|
* Get templategroups
|
|
*
|
|
* @return \Doctrine\Common\Collections\Collection
|
|
*/
|
|
public function getTemplategroups()
|
|
{
|
|
return $this->templategroups;
|
|
}
|
|
|
|
/**
|
|
* Set fonticon
|
|
*
|
|
* @param string $fonticon
|
|
*
|
|
* @return Page
|
|
*/
|
|
public function setFonticon($fonticon)
|
|
{
|
|
$this->fonticon = $fonticon;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get fonticon
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getFonticon()
|
|
{
|
|
return $this->fonticon;
|
|
}
|
|
}
|