->add('field_name', 'integer', array(
'label' => 'Your label here',
'data' => 0, // default value
'precision' => 0, // disallow floats
'constraints' => array(
new Assert\NotBlank(),
new Assert\Type('integer'),
new Assert\Regex(array(
'pattern' => '/^[0-9]\d*$/',
'message' => 'Please use only positive numbers.'
)
),
new Assert\Length(array('max' => 2))
)
))