deblan.tv/src/Deblan/Bundle/BlogBundle/Configuration/CommentCrudConfiguration.php
2015-03-02 21:57:49 +01:00

63 lines
1.5 KiB
PHP

<?php
namespace Deblan\Bundle\BlogBundle\Configuration;
class CommentCrudConfiguration extends \Trinity\Bundle\AdminBundle\Configuration\CrudConfiguration
{
public function __construct()
{
$this
->setModelNamespace('Deblan\\Bundle\\BlogBundle\\Model')
->setModel('Comment')
->setModelPeer('CommentPeer')
->setModelQuery('CommentQuery')
->setRoutePrefix('DeblanBlogBundleCommentAdmin')
->setFormNamespace('Deblan\\Bundle\\BlogBundle\\Form\Type')
->setFormEdit('CommentType')
->setFormFilter('CommentFilterType')
->setFormNew('CommentType')
->setFieldsets(array(
'' => array(
'Author',
'Website',
'Email',
'Content',
'Post',
'ParentComment',
'Active',
),
))
->setMaxPerPage(20)
->setRankable(false)
->setListTitle('Commentaires')
->setNewTitle('Nouveau commentaire')
->setEditTitle('Édition d\'un commentaire')
->setFieldTemplate('active', 'TrinityAdminBundle:BaseAdmin:bool.html.twig')
->setFieldTemplate('created_at', '::created_at.html.twig')
->setFieldTemplate('post_id', 'DeblanBlogBundle:CommentAdmin:post_id.html.twig')
->setSort('orderByCreatedAt', \Criteria::DESC)
//->setDisplayFields()
->setExport(true)
->setDisplayFields(array(
'Author',
'Email',
'post_id',
'created_at',
'active',
))
;
}
}