<commit_before><?php
namespace AdminBundle\Admin;

use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;

class ReservationAdmin extends AbstractAdmin
{
    public function toString($object)
    {
        return $object instanceof Reservation
            ? $object->getTitle()
            : 'Reservation'; // shown in the breadcrumb on the create view
    }
    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper->add('price','text');
        $formMapper->add('id_user','entity',array(
            'class' => 'AppBundle:User',
            'choice_label' => function ($user) {
                return $user->getId().' - '.$user->getUsername();
            }
        ));
        $formMapper->add('idVehicle','entity',array(
            'class' => 'AppBundle:Vehicle',
            'choice_label' => function ($vehicle) {
                return $vehicle->getId().' - '.$vehicle->getBrand().' - '.$vehicle->getModel();
            }
        ));
        $formMapper->add('start_date','date',array('years' => range(2017,date('Y'))));
        $formMapper->add('end_date','date',array('years' => range(2017,date('Y'))));
    }

    protected function configureListFields(ListMapper $listMapper)
    {
        $listMapper->addIdentifier('id');
        $listMapper->addIdentifier('price');
        $listMapper->addIdentifier('start_date','date');
        $listMapper->addIdentifier('end_date','date');
    }
}
<commit_msg>reservation admin date<commit_after><?php
namespace AdminBundle\Admin;

use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;

class ReservationAdmin extends AbstractAdmin
{
    public function toString($object)
    {
        return $object instanceof Reservation
            ? $object->getTitle()
            : 'Reservation'; // shown in the breadcrumb on the create view
    }
    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper->add('price','text');
        $formMapper->add('id_user','entity',array(
            'class' => 'AppBundle:User',
            'choice_label' => function ($user) {
                return $user->getId().' - '.$user->getUsername();
            }
        ));
        $formMapper->add('idVehicle','entity',array(
            'class' => 'AppBundle:Vehicle',
            'choice_label' => function ($vehicle) {
                return $vehicle->getId().' - '.$vehicle->getBrand().' - '.$vehicle->getModel();
            }
        ));
        $formMapper->add('start_date','date',array('years' => range(2017,date('Y'))));
        $formMapper->add('end_date','date',array('years' => range(2018,date('Y'))));
    }

    protected function configureListFields(ListMapper $listMapper)
    {
        $listMapper->addIdentifier('id');
        $listMapper->addIdentifier('price');
        $listMapper->addIdentifier('start_date','date');
        $listMapper->addIdentifier('end_date','date');
    }
}

{'fraction_non_alphanumeric': 0.16259129882502382, 'fraction_numerical': 0.0050809780882819944, 'mean_word_length': 2.9622641509433962, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4615422', 'n_tokens_mistral': 908, 'n_tokens_neox': 887, 'n_words': 138}