3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
10 namespace Zend\Form\Annotation
;
12 use Zend\Filter\Boolean
as BooleanFilter
;
15 * AllowEmpty annotation
17 * Presence of this annotation is a hint that the associated
18 * \Zend\InputFilter\Input should enable the allowEmpty flag.
27 protected $allowEmpty = true;
30 * Receive and process the contents of an annotation
34 public function __construct(array $data)
36 if (!isset($data['value'])) {
37 $data['value'] = false;
40 $allowEmpty = $data['value'];
42 if (!is_bool($allowEmpty)) {
43 $filter = new BooleanFilter();
44 $allowEmpty = $filter->filter($allowEmpty);
47 $this->allowEmpty
= $allowEmpty;
51 * Get value of required flag
55 public function getAllowEmpty()
57 return $this->allowEmpty
;