Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Form / Annotation / AllowEmpty.php
blobfec8ab0d534a63b59aad8a764da10b1ebac6c518
1 <?php
2 /**
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
8 */
10 namespace Zend\Form\Annotation;
12 use Zend\Filter\Boolean as BooleanFilter;
14 /**
15 * AllowEmpty annotation
17 * Presence of this annotation is a hint that the associated
18 * \Zend\InputFilter\Input should enable the allowEmpty flag.
20 * @Annotation
22 class AllowEmpty
24 /**
25 * @var bool
27 protected $allowEmpty = true;
29 /**
30 * Receive and process the contents of an annotation
32 * @param array $data
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;
50 /**
51 * Get value of required flag
53 * @return bool
55 public function getAllowEmpty()
57 return $this->allowEmpty;