Created the article viewer
Signed-off-by: Gergely POLONKAI (W00d5t0ck) <polesz@w00d5t0ck.info>
This commit is contained in:
270
src/KekRozsak/FrontBundle/Entity/Article.php
Normal file
270
src/KekRozsak/FrontBundle/Entity/Article.php
Normal file
@@ -0,0 +1,270 @@
|
||||
<?php
|
||||
|
||||
namespace KekRozsak\FrontBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* KekRozsak\FrontBundle\Entity\Article
|
||||
*/
|
||||
class Article
|
||||
{
|
||||
/**
|
||||
* @var integer $id
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string $title
|
||||
*/
|
||||
private $title;
|
||||
|
||||
/**
|
||||
* @var string $slug
|
||||
*/
|
||||
private $slug;
|
||||
|
||||
/**
|
||||
* @var text $text
|
||||
*/
|
||||
private $text;
|
||||
|
||||
/**
|
||||
* @var string $source
|
||||
*/
|
||||
private $source;
|
||||
|
||||
/**
|
||||
* @var DateTime $created_at
|
||||
*/
|
||||
private $created_at;
|
||||
|
||||
/**
|
||||
* @var DateTime $updated_at
|
||||
*/
|
||||
private $updated_at;
|
||||
|
||||
/**
|
||||
* @var text $update_reason
|
||||
*/
|
||||
private $update_reason;
|
||||
|
||||
/**
|
||||
* @var KekRozsak\FrontBundle\Entity\User
|
||||
*/
|
||||
private $created_by;
|
||||
|
||||
/**
|
||||
* @var KekRozsak\FrontBundle\Entity\User
|
||||
*/
|
||||
private $updated_by;
|
||||
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set title
|
||||
*
|
||||
* @param string $title
|
||||
* @return Article
|
||||
*/
|
||||
public function setTitle($title)
|
||||
{
|
||||
$this->title = $title;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get title
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle()
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set slug
|
||||
*
|
||||
* @param string $slug
|
||||
* @return Article
|
||||
*/
|
||||
public function setSlug($slug)
|
||||
{
|
||||
$this->slug = $slug;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get slug
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSlug()
|
||||
{
|
||||
return $this->slug;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set text
|
||||
*
|
||||
* @param text $text
|
||||
* @return Article
|
||||
*/
|
||||
public function setText($text)
|
||||
{
|
||||
$this->text = $text;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get text
|
||||
*
|
||||
* @return text
|
||||
*/
|
||||
public function getText()
|
||||
{
|
||||
return $this->text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set source
|
||||
*
|
||||
* @param string $source
|
||||
* @return Article
|
||||
*/
|
||||
public function setSource($source)
|
||||
{
|
||||
$this->source = $source;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get source
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSource()
|
||||
{
|
||||
return $this->source;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set created_at
|
||||
*
|
||||
* @param DateTime $createdAt
|
||||
* @return Article
|
||||
*/
|
||||
public function setCreatedAt(\DateTime $createdAt)
|
||||
{
|
||||
$this->created_at = $createdAt;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get created_at
|
||||
*
|
||||
* @return DateTime
|
||||
*/
|
||||
public function getCreatedAt()
|
||||
{
|
||||
return $this->created_at;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set updated_at
|
||||
*
|
||||
* @param DateTime $updatedAt
|
||||
* @return Article
|
||||
*/
|
||||
public function setUpdatedAt(\DateTime $updatedAt)
|
||||
{
|
||||
$this->updated_at = $updatedAt;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get updated_at
|
||||
*
|
||||
* @return DateTime
|
||||
*/
|
||||
public function getUpdatedAt()
|
||||
{
|
||||
return $this->updated_at;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set update_reason
|
||||
*
|
||||
* @param text $updateReason
|
||||
* @return Article
|
||||
*/
|
||||
public function setUpdateReason($updateReason)
|
||||
{
|
||||
$this->update_reason = $updateReason;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get update_reason
|
||||
*
|
||||
* @return text
|
||||
*/
|
||||
public function getUpdateReason()
|
||||
{
|
||||
return $this->update_reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set created_by
|
||||
*
|
||||
* @param KekRozsak\FrontBundle\Entity\User $createdBy
|
||||
* @return Article
|
||||
*/
|
||||
public function setCreatedBy(\KekRozsak\FrontBundle\Entity\User $createdBy = null)
|
||||
{
|
||||
$this->created_by = $createdBy;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get created_by
|
||||
*
|
||||
* @return KekRozsak\FrontBundle\Entity\User
|
||||
*/
|
||||
public function getCreatedBy()
|
||||
{
|
||||
return $this->created_by;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set updated_by
|
||||
*
|
||||
* @param KekRozsak\FrontBundle\Entity\User $updatedBy
|
||||
* @return Article
|
||||
*/
|
||||
public function setUpdatedBy(\KekRozsak\FrontBundle\Entity\User $updatedBy = null)
|
||||
{
|
||||
$this->updated_by = $updatedBy;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get updated_by
|
||||
*
|
||||
* @return KekRozsak\FrontBundle\Entity\User
|
||||
*/
|
||||
public function getUpdatedBy()
|
||||
{
|
||||
return $this->updated_by;
|
||||
}
|
||||
}
|
139
src/KekRozsak/FrontBundle/Entity/Role.php
Normal file
139
src/KekRozsak/FrontBundle/Entity/Role.php
Normal file
@@ -0,0 +1,139 @@
|
||||
<?php
|
||||
|
||||
namespace KekRozsak\FrontBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* KekRozsak\FrontBundle\Entity\Role
|
||||
*/
|
||||
class Role
|
||||
{
|
||||
/**
|
||||
* @var integer $id
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string $name
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @var string $display_name
|
||||
*/
|
||||
private $display_name;
|
||||
|
||||
/**
|
||||
* @var boolean $can_be_assigned
|
||||
*/
|
||||
private $can_be_assigned;
|
||||
|
||||
/**
|
||||
* @var \Doctrine\Common\Collections\ArrayCollection
|
||||
*/
|
||||
private $included_roles;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->included_roles = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set name
|
||||
*
|
||||
* @param string $name
|
||||
* @return Role
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set display_name
|
||||
*
|
||||
* @param string $displayName
|
||||
* @return Role
|
||||
*/
|
||||
public function setDisplayName($displayName)
|
||||
{
|
||||
$this->display_name = $displayName;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get display_name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDisplayName()
|
||||
{
|
||||
return $this->display_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set can_be_assigned
|
||||
*
|
||||
* @param boolean $canBeAssigned
|
||||
* @return Role
|
||||
*/
|
||||
public function setCanBeAssigned($canBeAssigned)
|
||||
{
|
||||
$this->can_be_assigned = $canBeAssigned;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get can_be_assigned
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getCanBeAssigned()
|
||||
{
|
||||
return $this->can_be_assigned;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add included_roles
|
||||
*
|
||||
* @param KekRozsak\FrontBundle\Entity\Role $includedRoles
|
||||
* @return Role
|
||||
*/
|
||||
public function addRole(\KekRozsak\FrontBundle\Entity\Role $includedRoles)
|
||||
{
|
||||
$this->included_roles[] = $includedRoles;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get included_roles
|
||||
*
|
||||
* @return Doctrine\Common\Collections\Collection
|
||||
*/
|
||||
public function getIncludedRoles()
|
||||
{
|
||||
return $this->included_roles;
|
||||
}
|
||||
}
|
193
src/KekRozsak/FrontBundle/Entity/User.php
Normal file
193
src/KekRozsak/FrontBundle/Entity/User.php
Normal file
@@ -0,0 +1,193 @@
|
||||
<?php
|
||||
|
||||
namespace KekRozsak\FrontBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* KekRozsak\FrontBundle\Entity\User
|
||||
*/
|
||||
class User
|
||||
{
|
||||
/**
|
||||
* @var integer $id
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string $username
|
||||
*/
|
||||
private $username;
|
||||
|
||||
/**
|
||||
* @var string $password
|
||||
*/
|
||||
private $password;
|
||||
|
||||
/**
|
||||
* @var string $email
|
||||
*/
|
||||
private $email;
|
||||
|
||||
/**
|
||||
* @var DateTime $registered_at
|
||||
*/
|
||||
private $registered_at;
|
||||
|
||||
/**
|
||||
* @var string $display_name
|
||||
*/
|
||||
private $display_name;
|
||||
|
||||
/**
|
||||
* @var \Doctrine\Common\Collections\ArrayCollection
|
||||
*/
|
||||
private $roles;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->roles = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set username
|
||||
*
|
||||
* @param string $username
|
||||
* @return User
|
||||
*/
|
||||
public function setUsername($username)
|
||||
{
|
||||
$this->username = $username;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get username
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUsername()
|
||||
{
|
||||
return $this->username;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set password
|
||||
*
|
||||
* @param string $password
|
||||
* @return User
|
||||
*/
|
||||
public function setPassword($password)
|
||||
{
|
||||
$this->password = $password;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get password
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPassword()
|
||||
{
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set email
|
||||
*
|
||||
* @param string $email
|
||||
* @return User
|
||||
*/
|
||||
public function setEmail($email)
|
||||
{
|
||||
$this->email = $email;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get email
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEmail()
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set registered_at
|
||||
*
|
||||
* @param DateTime $registeredAt
|
||||
* @return User
|
||||
*/
|
||||
public function setRegisteredAt(\DateTime $registeredAt)
|
||||
{
|
||||
$this->registered_at = $registeredAt;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get registered_at
|
||||
*
|
||||
* @return DateTime
|
||||
*/
|
||||
public function getRegisteredAt()
|
||||
{
|
||||
return $this->registered_at;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set display_name
|
||||
*
|
||||
* @param string $displayName
|
||||
* @return User
|
||||
*/
|
||||
public function setDisplayName($displayName)
|
||||
{
|
||||
$this->display_name = $displayName;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get display_name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDisplayName()
|
||||
{
|
||||
return $this->display_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add roles
|
||||
*
|
||||
* @param KekRozsak\FrontBundle\Entity\Role $roles
|
||||
* @return User
|
||||
*/
|
||||
public function addRole(\KekRozsak\FrontBundle\Entity\Role $roles)
|
||||
{
|
||||
$this->roles[] = $roles;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get roles
|
||||
*
|
||||
* @return Doctrine\Common\Collections\Collection
|
||||
*/
|
||||
public function getRoles()
|
||||
{
|
||||
return $this->roles;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user