Skip to content

Commit

Permalink
Merge branch 'nonRequiredFields' of https://github.com/Tocacar/protalk
Browse files Browse the repository at this point in the history
…into nonRequiredFields
  • Loading branch information
Kim Rowan committed Nov 5, 2012
2 parents b261903 + 375ece0 commit 4f1db22
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/Protalk/AdminBundle/Admin/MediaAdmin.php
Expand Up @@ -11,7 +11,7 @@

/**
* Admin for media
*
*
* This class handles fields for the media data.
*
* @category AdminBundle
Expand All @@ -34,10 +34,10 @@ class MediaAdmin extends Admin
{
/**
* Configure form fields
*
*
* This function creates a form for the media.
*
* @param FormMapper $formMapper
*
* @param FormMapper $formMapper
*/
protected function configureFormFields(FormMapper $formMapper)
{
Expand All @@ -51,8 +51,8 @@ protected function configureFormFields(FormMapper $formMapper)
->add('date')
->add('description')
->add('length')
->add('rating')
->add('visits')
->add('rating', null, array('required' => false))
->add('visits', null, array('required' => false))
->add('content')
->add('slides')
->add('joindin')
Expand All @@ -75,10 +75,10 @@ protected function configureFormFields(FormMapper $formMapper)

/**
* Configure data grid filters
*
*
* This function add Title to datagrid mapper.
*
* @param DatagridMapper $datagridMapper
*
* @param DatagridMapper $datagridMapper
*/
protected function configureDatagridFilters(DatagridMapper $datagridMapper)
{
Expand All @@ -87,10 +87,10 @@ protected function configureDatagridFilters(DatagridMapper $datagridMapper)

/**
* Configure list fields
*
*
* This function adds isPublished identifier to the Title.
*
* @param ListMapper $listMapper
*
* @param ListMapper $listMapper
*/
protected function configureListFields(ListMapper $listMapper)
{
Expand All @@ -99,23 +99,23 @@ protected function configureListFields(ListMapper $listMapper)

/**
* Validator function
*
*
* This function validates that title of the media is no longer
* than 255 characters long.
*
*
* @param ErrorElement $errorElement
* @param type $object
* @param type $object
*/
public function validate(ErrorElement $errorElement, $object)
{
$errorElement->with('title')->assertMaxLength(array('limit' => 255))->end();
}

/**
* Get batch actions for media
*
*
* This function retrieves the default (currently only the delete action) actions.
*
*
* @return array $action container for different actions for media
*/
public function getBatchActions()
Expand Down

0 comments on commit 4f1db22

Please sign in to comment.