2012-07-01 17:11:31 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace KekRozsak\FrontBundle\Entity;
|
|
|
|
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
|
2012-07-15 12:56:31 +00:00
|
|
|
use KekRozsak\SecurityBundle\Entity\User;
|
2012-07-13 10:07:21 +00:00
|
|
|
|
2012-07-15 12:56:31 +00:00
|
|
|
/**
|
2012-07-13 10:07:21 +00:00
|
|
|
* @ORM\Entity
|
|
|
|
* @ORM\Table(name="articles")
|
2012-07-01 17:11:31 +00:00
|
|
|
*/
|
|
|
|
class Article
|
|
|
|
{
|
2012-07-13 10:07:21 +00:00
|
|
|
/**
|
|
|
|
* @var integer $id
|
|
|
|
* @ORM\Id
|
|
|
|
* @ORM\GeneratedValue(strategy="AUTO")
|
2012-07-15 12:56:31 +00:00
|
|
|
* @ORM\Column(type="integer")
|
2012-07-13 10:07:21 +00:00
|
|
|
*/
|
2012-07-17 16:47:20 +00:00
|
|
|
protected $id;
|
2012-07-13 10:07:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get id
|
|
|
|
*
|
2012-07-15 12:56:31 +00:00
|
|
|
* @return integer
|
2012-07-13 10:07:21 +00:00
|
|
|
*/
|
|
|
|
public function getId()
|
|
|
|
{
|
|
|
|
return $this->id;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2012-07-15 12:56:31 +00:00
|
|
|
* @var KekRozsak\SecurityBundle\Entity\User $createdBy
|
|
|
|
* @ORM\ManyToOne(targetEntity="KekRozsak\SecurityBundle\Entity\User")
|
|
|
|
* @ORM\JoinColumn(name="created_by_id")
|
2012-07-13 10:07:21 +00:00
|
|
|
*/
|
2012-07-17 16:47:20 +00:00
|
|
|
protected $createdBy;
|
2012-07-13 10:07:21 +00:00
|
|
|
|
|
|
|
/**
|
2012-07-15 12:56:31 +00:00
|
|
|
* Set createdBy
|
2012-07-13 10:07:21 +00:00
|
|
|
*
|
2012-07-15 12:56:31 +00:00
|
|
|
* @param KekRozsak\SecurityBundle\Entity\User $createdBy
|
2012-07-13 10:07:21 +00:00
|
|
|
* @return Article
|
|
|
|
*/
|
2012-07-15 12:56:31 +00:00
|
|
|
public function setCreatedBy(\KekRozsak\SecurityBundle\Entity\User $createdBy)
|
2012-07-13 10:07:21 +00:00
|
|
|
{
|
2012-07-15 12:56:31 +00:00
|
|
|
$this->createdBy = $createdBy;
|
2012-07-13 10:07:21 +00:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2012-07-15 12:56:31 +00:00
|
|
|
* Get createdBy
|
2012-07-13 10:07:21 +00:00
|
|
|
*
|
2012-07-15 12:56:31 +00:00
|
|
|
* @return KekRozsak\SecurityBundle\Entity\User
|
2012-07-13 10:07:21 +00:00
|
|
|
*/
|
2012-07-15 12:56:31 +00:00
|
|
|
public function getCreatedBy()
|
2012-07-13 10:07:21 +00:00
|
|
|
{
|
2012-07-15 12:56:31 +00:00
|
|
|
return $this->createdBy;
|
2012-07-13 10:07:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var DateTime $createdAt
|
2012-07-15 12:56:31 +00:00
|
|
|
* @ORM\Column(type="datetime", name="created_at", nullable=false)
|
2012-07-13 10:07:21 +00:00
|
|
|
*/
|
2012-07-17 16:47:20 +00:00
|
|
|
protected $createdAt;
|
2012-07-13 10:07:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set createdAt
|
|
|
|
*
|
|
|
|
* @param DateTime $createdAt
|
|
|
|
* @return Article
|
|
|
|
*/
|
|
|
|
public function setCreatedAt(\DateTime $createdAt)
|
|
|
|
{
|
|
|
|
$this->createdAt = $createdAt;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get createdAt
|
|
|
|
*
|
2012-07-15 12:56:31 +00:00
|
|
|
* @return DateTime
|
2012-07-13 10:07:21 +00:00
|
|
|
*/
|
|
|
|
public function getCreatedAt()
|
|
|
|
{
|
|
|
|
return $this->createdAt;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2012-07-15 12:56:31 +00:00
|
|
|
* @var string $title
|
|
|
|
* @ORM\Column(type="string", length=100, nullable=false, unique=true)
|
2012-07-13 10:07:21 +00:00
|
|
|
*/
|
2012-07-17 16:47:20 +00:00
|
|
|
protected $title;
|
2012-07-13 10:07:21 +00:00
|
|
|
|
|
|
|
/**
|
2012-07-15 12:56:31 +00:00
|
|
|
* Set title
|
2012-07-13 10:07:21 +00:00
|
|
|
*
|
2012-07-15 12:56:31 +00:00
|
|
|
* @param string $title
|
2012-07-13 10:07:21 +00:00
|
|
|
* @return Article
|
|
|
|
*/
|
2012-07-15 12:56:31 +00:00
|
|
|
public function setTitle($title)
|
2012-07-13 10:07:21 +00:00
|
|
|
{
|
2012-07-15 12:56:31 +00:00
|
|
|
$this->title = $title;
|
2012-07-13 10:07:21 +00:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2012-07-15 12:56:31 +00:00
|
|
|
* Get title
|
2012-07-13 10:07:21 +00:00
|
|
|
*
|
2012-07-15 12:56:31 +00:00
|
|
|
* @return string
|
2012-07-13 10:07:21 +00:00
|
|
|
*/
|
2012-07-15 12:56:31 +00:00
|
|
|
public function getTitle()
|
2012-07-13 10:07:21 +00:00
|
|
|
{
|
2012-07-15 12:56:31 +00:00
|
|
|
return $this->title;
|
2012-07-13 10:07:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2012-07-15 12:56:31 +00:00
|
|
|
* @var string $slug
|
|
|
|
* @ORM\Column(type="string", length=100, nullable=false, unique=true)
|
2012-07-13 10:07:21 +00:00
|
|
|
*/
|
2012-07-17 16:47:20 +00:00
|
|
|
protected $slug;
|
2012-07-13 10:07:21 +00:00
|
|
|
|
|
|
|
/**
|
2012-07-15 12:56:31 +00:00
|
|
|
* Set slug
|
2012-07-13 10:07:21 +00:00
|
|
|
*
|
2012-07-15 12:56:31 +00:00
|
|
|
* @param string $slug
|
2012-07-13 10:07:21 +00:00
|
|
|
* @return Article
|
|
|
|
*/
|
2012-07-15 12:56:31 +00:00
|
|
|
public function setSlug($slug)
|
2012-07-13 10:07:21 +00:00
|
|
|
{
|
2012-07-15 12:56:31 +00:00
|
|
|
$this->slug = $slug;
|
2012-07-13 10:07:21 +00:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2012-07-15 12:56:31 +00:00
|
|
|
* Get slug
|
2012-07-13 10:07:21 +00:00
|
|
|
*
|
2012-07-15 12:56:31 +00:00
|
|
|
* @return string
|
2012-07-13 10:07:21 +00:00
|
|
|
*/
|
2012-07-15 12:56:31 +00:00
|
|
|
public function getSlug()
|
2012-07-13 10:07:21 +00:00
|
|
|
{
|
2012-07-15 12:56:31 +00:00
|
|
|
return $this->slug;
|
2012-07-13 10:07:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2012-07-15 12:56:31 +00:00
|
|
|
* @var string $text
|
|
|
|
* @ORM\Column(type="text", nullable=false)
|
2012-07-13 10:07:21 +00:00
|
|
|
*/
|
2012-07-17 16:47:20 +00:00
|
|
|
protected $text;
|
2012-07-13 10:07:21 +00:00
|
|
|
|
|
|
|
/**
|
2012-07-15 12:56:31 +00:00
|
|
|
* Set text
|
2012-07-13 10:07:21 +00:00
|
|
|
*
|
2012-07-15 12:56:31 +00:00
|
|
|
* @param string $text
|
2012-07-13 10:07:21 +00:00
|
|
|
* @return Article
|
|
|
|
*/
|
2012-07-15 12:56:31 +00:00
|
|
|
public function setText($text)
|
2012-07-13 10:07:21 +00:00
|
|
|
{
|
2012-07-15 12:56:31 +00:00
|
|
|
$this->text = $text;
|
2012-07-13 10:07:21 +00:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2012-07-15 12:56:31 +00:00
|
|
|
* Get text
|
2012-07-13 10:07:21 +00:00
|
|
|
*
|
2012-07-15 12:56:31 +00:00
|
|
|
* return string
|
2012-07-13 10:07:21 +00:00
|
|
|
*/
|
2012-07-15 12:56:31 +00:00
|
|
|
public function getText()
|
2012-07-13 10:07:21 +00:00
|
|
|
{
|
2012-07-15 12:56:31 +00:00
|
|
|
return $this->text;
|
2012-07-13 10:07:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2012-07-15 12:56:31 +00:00
|
|
|
* @var boolean $mainPage
|
|
|
|
* @ORM\Column(type="boolean", name="main_page")
|
2012-07-13 10:07:21 +00:00
|
|
|
*/
|
2012-07-17 16:47:20 +00:00
|
|
|
protected $mainPage;
|
2012-07-13 10:07:21 +00:00
|
|
|
|
|
|
|
/**
|
2012-07-15 12:56:31 +00:00
|
|
|
* Set mainPage
|
2012-07-13 10:07:21 +00:00
|
|
|
*
|
2012-07-15 12:56:31 +00:00
|
|
|
* @param boolean $mainPage
|
2012-07-13 10:07:21 +00:00
|
|
|
* @return Article
|
|
|
|
*/
|
2012-07-15 12:56:31 +00:00
|
|
|
public function setMainPage($mainPage)
|
2012-07-13 10:07:21 +00:00
|
|
|
{
|
2012-07-15 12:56:31 +00:00
|
|
|
$this->mainPage = $mainPage;
|
2012-07-13 10:07:21 +00:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2012-07-15 12:56:31 +00:00
|
|
|
* Get mainPage
|
2012-07-13 10:07:21 +00:00
|
|
|
*
|
2012-07-15 12:56:31 +00:00
|
|
|
* @return boolean
|
2012-07-13 10:07:21 +00:00
|
|
|
*/
|
2012-07-15 12:56:31 +00:00
|
|
|
public function getMainPage()
|
2012-07-13 10:07:21 +00:00
|
|
|
{
|
2012-07-15 12:56:31 +00:00
|
|
|
return $this->mainPage;
|
2012-07-13 10:07:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2012-07-15 12:56:31 +00:00
|
|
|
* @var boolean public
|
|
|
|
* @ORM\Column(type="boolean", nullable=false)
|
2012-07-13 10:07:21 +00:00
|
|
|
*/
|
2012-07-17 16:47:20 +00:00
|
|
|
protected $public;
|
2012-07-13 10:07:21 +00:00
|
|
|
|
|
|
|
/**
|
2012-07-15 12:56:31 +00:00
|
|
|
* Set public
|
2012-07-13 10:07:21 +00:00
|
|
|
*
|
2012-07-15 12:56:31 +00:00
|
|
|
* @param boolean $public
|
2012-07-13 10:07:21 +00:00
|
|
|
* @return Article
|
|
|
|
*/
|
2012-07-15 12:56:31 +00:00
|
|
|
public function setPublic($public = false)
|
2012-07-13 10:07:21 +00:00
|
|
|
{
|
2012-07-15 12:56:31 +00:00
|
|
|
$this->public = $public;
|
2012-07-13 10:07:21 +00:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2012-07-15 12:56:31 +00:00
|
|
|
* Get public
|
2012-07-13 10:07:21 +00:00
|
|
|
*
|
2012-07-15 12:56:31 +00:00
|
|
|
* @return boolean
|
2012-07-13 10:07:21 +00:00
|
|
|
*/
|
2012-07-15 12:56:31 +00:00
|
|
|
public function isPublic()
|
2012-07-13 10:07:21 +00:00
|
|
|
{
|
2012-07-15 12:56:31 +00:00
|
|
|
return $this->public;
|
2012-07-13 10:07:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2012-07-15 12:56:31 +00:00
|
|
|
* @var string $source
|
|
|
|
* @ORM\Column(type="string", nullable=true)
|
2012-07-13 10:07:21 +00:00
|
|
|
*/
|
2012-07-17 16:47:20 +00:00
|
|
|
protected $source;
|
2012-07-13 10:07:21 +00:00
|
|
|
|
|
|
|
/**
|
2012-07-15 12:56:31 +00:00
|
|
|
* Set source
|
2012-07-13 10:07:21 +00:00
|
|
|
*
|
2012-07-15 12:56:31 +00:00
|
|
|
* @param string $source
|
2012-07-13 10:07:21 +00:00
|
|
|
* @return Article
|
|
|
|
*/
|
2012-07-15 12:56:31 +00:00
|
|
|
public function setSource($source = null)
|
2012-07-13 10:07:21 +00:00
|
|
|
{
|
2012-07-15 12:56:31 +00:00
|
|
|
$this->source = $source;
|
2012-07-13 10:07:21 +00:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2012-07-15 12:56:31 +00:00
|
|
|
* Get source
|
2012-07-13 10:07:21 +00:00
|
|
|
*
|
2012-07-15 12:56:31 +00:00
|
|
|
* @return string
|
2012-07-13 10:07:21 +00:00
|
|
|
*/
|
2012-07-15 12:56:31 +00:00
|
|
|
public function getSource()
|
2012-07-13 10:07:21 +00:00
|
|
|
{
|
2012-07-15 12:56:31 +00:00
|
|
|
return $this->source;
|
2012-07-13 10:07:21 +00:00
|
|
|
}
|
|
|
|
}
|
2012-07-15 12:56:31 +00:00
|
|
|
|