1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace Cube\Validate;
- class NotEmpty extends AbstractValidate
- {
- protected $_message = "'%s' is required and cannot be empty.";
-
-
- public function isValid()
- {
- if (empty($this->_value) && $this->_value !== '0') {
- return false;
- }
- else if (is_array($this->_value)) {
- $array = array_filter($this->_value);
-
- if (empty($array)) {
- return false;
- }
- }
- return true;
- }
- }
|