Commit a63ec22e authored by dj3c1t's avatar dj3c1t

publicationDate in Author

parent 20c5c6cf
......@@ -13,11 +13,12 @@ class AuthorController extends Controller {
$em = $this->get('doctrine')->getManager();
$query = $em->createQuery("
SELECT a FROM Dj3c1tSourceMLBundle:Author a
ORDER BY a.publicationDate DESC
");
$authors = $this->get('knp_paginator')->paginate(
$query,
$request->query->getInt('page', 1),
12
36
);
return $this->render(
'Dj3c1tSourceMLBundle:Source:Author/index.html.twig',
......
......@@ -3,6 +3,7 @@
namespace Dj3c1t\SourceMLBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* Author
......@@ -74,6 +75,14 @@ class Author
private $useCaptcha;
/**
* @var \DateTime
*
* @Gedmo\Timestampable(on="create")
* @ORM\Column(name="publication_date", type="datetime")
*/
private $publicationDate;
/**
* @var string
*/
protected $url;
......@@ -330,4 +339,27 @@ class Author
return $this->url;
}
/**
* Set publicationDate
*
* @param \DateTime $publicationDate
* @return Author
*/
public function setPublicationDate($publicationDate)
{
$this->publicationDate = $publicationDate;
return $this;
}
/**
* Get publicationDate
*
* @return \DateTime
*/
public function getPublicationDate()
{
return $this->publicationDate;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment