Переделка для composer autoload
This commit is contained in:
parent
ad69746347
commit
b5641db607
100 changed files with 14 additions and 325 deletions
29
src/validator/rule/notnull.php
Normal file
29
src/validator/rule/notnull.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
require_once 'abstract.php';
|
||||
|
||||
class Rule_Notnull extends Rule_Abstract
|
||||
{
|
||||
function skipEmpty() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getErrorMsg()
|
||||
{
|
||||
return "Поле не должно быть пустым";
|
||||
}
|
||||
|
||||
public function isValid(Collection $container, $status = null)
|
||||
{
|
||||
$data = $container->get($this->field);
|
||||
if (is_array($data)) {
|
||||
foreach($data as $c) {
|
||||
if (trim($c) != '') return true;
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
$value = trim($data);
|
||||
return $value != '';
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue