Skip to content

Commit

Permalink
cleaned a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
phiamo committed May 29, 2015
1 parent 4fc4457 commit 89c8acf
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 12 deletions.
24 changes: 15 additions & 9 deletions Entity/DateTimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ class DateTimeTest
private $name;

/**
* @var datetime $start
* @var \DateTime $start
*
* @ORM\Column(name="start", type="datetime")
*/
private $start;

/**
* @var datetime $end
* @var \DateTime $end
*
* @ORM\Column(name="end", type="datetime")
*/
Expand All @@ -56,6 +56,9 @@ public function getId()
return $this->id;
}

/**
* @param $id
*/
public function setId($id)
{
$this->id = $id;
Expand All @@ -65,7 +68,7 @@ public function setId($id)
* Set name
*
* @param string $name
* @return Transmission
* @return DateTimeTest
*/
public function setName($name)
{
Expand All @@ -87,8 +90,8 @@ public function getName()
/**
* Set start
*
* @param datetime $start
* @return Transmission
* @param \DateTime $start
* @return DateTimeTest
*/
public function setStart($start)
{
Expand All @@ -100,13 +103,16 @@ public function setStart($start)
/**
* Get start
*
* @return datetime
* @return \DateTime
*/
public function getStart()
{
return $this->start;
}

/**
* @return \DateTime
*/
public function getBegin()
{
return $this->getStart();
Expand All @@ -115,8 +121,8 @@ public function getBegin()
/**
* Set end
*
* @param datetime $end
* @return Transmission
* @param \DateTime $end
* @return DateTimeTest
*/
public function setEnd($end)
{
Expand All @@ -128,7 +134,7 @@ public function setEnd($end)
/**
* Get end
*
* @return datetime
* @return \DateTime
*/
public function getEnd()
{
Expand Down
15 changes: 12 additions & 3 deletions Form/Type/ExampleDateFormType.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,38 @@

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

class ExampleDateFormType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('startAt','date', array(
->add('startAt', 'date', array(
'attr' => array('class' => 'startdate span1'),
'widget' => 'choice',
'format' => 'dd MM yyyy',
))
->add('endAt','date', array(
->add('endAt', 'date', array(
'attr' => array('class' => 'enddate span2'),
'widget' => 'choice',
'format' => 'dd MM yyyy',
))
->add('special','checkbox', array(
->add('special', 'checkbox', array(
'label' => 'Special?',
'required' => false,
))
;
}


/**
* @return string
*/
public function getName()
{
return 'example_date';
Expand Down
7 changes: 7 additions & 0 deletions Form/Type/ExampleDateTimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
class ExampleDateTimeTest extends AbstractType
{

/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
Expand All @@ -24,6 +28,9 @@ public function buildForm(FormBuilderInterface $builder, array $options)
;
}

/**
* @return string
*/
public function getName()
{
return 'datetime_test';
Expand Down
12 changes: 12 additions & 0 deletions Form/Type/ExampleExtendedFormType.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

class ExampleExtendedFormType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
Expand Down Expand Up @@ -214,13 +218,21 @@ public function buildForm(FormBuilderInterface $builder, array $options)
))
;
}

/**
* @param OptionsResolverInterface $resolver
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'render_fieldset' => false,
'show_legend' => false,
));
}

/**
* @return string
*/
public function getName()
{
return 'mopa_bootstrap_example_extended_forms';
Expand Down

0 comments on commit 89c8acf

Please sign in to comment.