kekrozsak/src/KekRozsak/FrontBundle/Entity/Document.php

211 lines
3.3 KiB
PHP
Raw Normal View History

<?php
namespace KekRozsak\FrontBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
2012-07-16 19:17:23 +00:00
use Doctrine\Common\Collections\ArrayCollection;
2012-07-16 19:17:23 +00:00
use KekRozsak\SecurityBundle\Entity\User;
use KekRozsak\FrontBundle\Entity\Group;
/**
* KekRozsak\FrontBundle\Entity\Document
* @ORM\Entity
* @ORM\Table(name="documents")
*/
class Document
{
2012-07-16 19:17:23 +00:00
public function __construct()
{
$this->groups = new ArrayCollection();
}
/**
2012-07-16 19:17:23 +00:00
* @var integer $id
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @ORM\Column(type="integer")
*/
2012-07-16 19:17:23 +00:00
protected $id;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* @var string $title
2012-07-16 19:17:23 +00:00
* @ORM\Column(type="string", length=150, unique=true, nullable=false)
*/
2012-07-16 19:17:23 +00:00
protected $title;
/**
* Set title
*
* @param string $title
* @return Document
*/
2012-07-16 19:17:23 +00:00
public function setTitle($title)
{
$this->title = $title;
return $this;
}
/**
* Get title
*
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
2012-07-16 19:17:23 +00:00
* @var string $slug
* @ORM\Column(type="string", length=150, unique=true, nullable=false)
*/
2012-07-16 19:17:23 +00:00
protected $slug;
/**
* Set slug
*
* @param string $slug
* @return Document
*/
2012-07-16 19:17:23 +00:00
public function setSlug($slug)
{
$this->slug = $slug;
return $this;
}
2012-07-16 19:17:23 +00:00
/**
* Get slug
*
* @return string
*/
public function getSlug()
{
return $this->slug;
}
/**
2012-07-16 19:17:23 +00:00
* @var KekRozsak\SecurityBundle\Entity\User $createdBy
* @ORM\ManyToOne(targetEntity="KekRozsak\SecurityBundle\Entity\User")
* @ORM\JoinColumn(name="created_by_id")
*/
2012-07-16 19:17:23 +00:00
protected $createdBy;
/**
2012-07-16 19:17:23 +00:00
* Set createdBy
*
2012-07-16 19:17:23 +00:00
* @param KekRozsak\SecurityBundle\Entity\User $createdBy
* @return Document
*/
2012-07-16 19:17:23 +00:00
public function setCreatedBy(\KekRozsak\SecurityBundle\Entity\User $createdBy)
{
2012-07-16 19:17:23 +00:00
$this->createdBy = $createdBy;
return $this;
}
2012-07-16 19:17:23 +00:00
/**
2012-07-16 19:17:23 +00:00
* Get createdBy
*
2012-07-16 19:17:23 +00:00
* @return KekRozsak\SecurityBundle\Entity\User
*/
2012-07-16 19:17:23 +00:00
public function getCreatedBy()
{
2012-07-16 19:17:23 +00:00
return $this->createdBy;
}
/**
2012-07-16 19:17:23 +00:00
* @var DateTime $createdat
* @ORM\Column(type="datetime", nullable=false, name="created_at")
*/
2012-07-16 19:17:23 +00:00
protected $createdAt;
/**
* Set createdAt
*
* @param DateTime $createdAt
* @return Document
*/
public function setCreatedAt(\DateTime $createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* Get createdAt
*
* @return DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
2012-07-16 19:17:23 +00:00
* @var string $content
* @ORM\Column(type="text", nullable=false)
*/
2012-07-16 19:17:23 +00:00
protected $content;
/**
2012-07-16 19:17:23 +00:00
* Set content
*
2012-07-16 19:17:23 +00:00
* @param string $content
* @return Document
*/
2012-07-16 19:17:23 +00:00
public function setContent($content)
{
2012-07-16 19:17:23 +00:00
$this->content = $content;
return $this;
}
/**
2012-07-16 19:17:23 +00:00
* Get content
*
* @return string
*/
2012-07-16 19:17:23 +00:00
public function getContent()
{
2012-07-16 19:17:23 +00:00
return $this->content;
}
/**
2012-07-16 19:17:23 +00:00
* @var Doctrine\Common\Collections\ArrayCollection $groups
* @ORM\ManyToMany(targetEntity="KekRozsak\FrontBundle\Entity\Group", mappedBy="documents")
*/
2012-07-16 19:17:23 +00:00
protected $groups;
/**
2012-07-16 19:17:23 +00:00
* Add a group
*
2012-07-16 19:17:23 +00:00
* @param KekRozsak\FrontBundle\Entity\Group $group
* @return Document
*/
2012-07-16 19:17:23 +00:00
public function addGroup(\KekRozsak\FrontBundle\Entity\Group $group)
{
2012-07-16 19:17:23 +00:00
$this->groups[] = $group;
return $this;
}
/**
2012-07-16 19:17:23 +00:00
* Get all groups
*
2012-07-16 19:17:23 +00:00
* @return Doctrine\Common\Collections\ArrayCollection
*/
public function getGroups()
{
2012-07-16 19:17:23 +00:00
return $this->group;
}
}