<commit_before><?php

namespace Kdig\ArchaeologicalBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class UsType extends AbstractType
{
    protected $areaid;
    protected $id;
    
    public function __construct($areaid, $id)
    {
        $this->areaid = $areaid;
        $this->id = $id;
    }
    
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $idarea = $this->areaid;
        $idus = $this->id;
        
        if ($idarea != null)
            $builder->add('area', 'entity', array(
                'class' => 'KdigArchaeologicalBundle:Area',
                'query_builder' => function($repository) use ($idarea) {
                    $expr = new \Doctrine\ORM\Query\Expr();
                    return $repository->createQueryBuilder('p')
                        ->setParameter('idarea', $idarea)
                        ->add('where', ($expr->in('p.id', ':idarea')))
                        ->orderBy('p.name', 'ASC'); 
                },
                'property' => 'name',
                'label' => 'Area',
                'help'  => 'Select your excavation area'
            ));
        else
            $builder->add('area');
        
        $builder
            ->add('site', 'entity', array(
                'class' => 'KdigArchaeologicalBundle:Site',
                'query_builder' => function($repository) {
                    return $repository->createQueryBuilder('p')
                        ->orderBy('p.name', 'DESC'); 
                },
//                'attr' => array('sigla' => 'myValue'),
                'label' => 'Excavation campaign',
            ))
            ->add('name')
            ->add('typeus')
            ->add('sigla')
            ->add('remarks')
            ->add('media', 'entity', array(
                'class' => 'KdigMediaBundle:Media',
                'required' => false,
                'multiple' => true
            ))
        ;
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {<commit_msg>help_block<commit_after><?php

namespace Kdig\ArchaeologicalBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class UsType extends AbstractType
{
    protected $areaid;
    protected $id;
    
    public function __construct($areaid, $id)
    {
        $this->areaid = $areaid;
        $this->id = $id;
    }
    
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $idarea = $this->areaid;
        $idus = $this->id;
        
        if ($idarea != null)
            $builder->add('area', 'entity', array(
                'class' => 'KdigArchaeologicalBundle:Area',
                'query_builder' => function($repository) use ($idarea) {
                    $expr = new \Doctrine\ORM\Query\Expr();
                    return $repository->createQueryBuilder('p')
                        ->setParameter('idarea', $idarea)
                        ->add('where', ($expr->in('p.id', ':idarea')))
                        ->orderBy('p.name', 'ASC'); 
                },
                'property' => 'name',
                'label' => 'Area',
                'help_block'  => 'Select your excavation area'
            ));
        else
            $builder->add('area');
        
        $builder
            ->add('site', 'entity', array(
                'class' => 'KdigArchaeologicalBundle:Site',
                'query_builder' => function($repository) {
                    return $repository->createQueryBuilder('p')
                        ->orderBy('p.name', 'DESC'); 
                },
//                'attr' => array('sigla' => 'myValue'),
                'label' => 'Excavation campaign',
            ))
            ->add('name')
            ->add('typeus')
            ->add('sigla')
            ->add('remarks')
            ->add('media', 'entity', array(
                'class' => 'KdigMediaBundle:Media',
                'required' => false,
                'multiple' => true
            ))
        ;
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
{'fraction_non_alphanumeric': 0.14646581691772886, 'fraction_numerical': 0.0, 'mean_word_length': 1.6078549848942598, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 67, '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': '361645', 'n_tokens_mistral': 1183, 'n_tokens_neox': 1134, 'n_words': 210}