Правки namespace
This commit is contained in:
parent
ee06f1febb
commit
524b27936a
39 changed files with 141 additions and 120 deletions
48
src/Validator/Rule/AbstractRule.php
Normal file
48
src/Validator/Rule/AbstractRule.php
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
namespace ctiso\Validator\Rule;
|
||||
use ctiso\Collection;
|
||||
|
||||
abstract class AbstractRule
|
||||
{
|
||||
public $field;
|
||||
protected $errorMsg;
|
||||
protected $ctx;
|
||||
|
||||
public function __construct($field, $errorMsg = null)
|
||||
{
|
||||
$this->field = $field;
|
||||
$this->errorMsg = $errorMsg;
|
||||
}
|
||||
|
||||
public function setName($field)
|
||||
{
|
||||
$this->field = $field;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setErrorMsg($errorMsg)
|
||||
{
|
||||
$this->errorMsg = $errorMsg;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getErrorMsg()
|
||||
{
|
||||
return $this->errorMsg;
|
||||
}
|
||||
|
||||
public function isValid(Collection $container, $status = null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
function skipEmpty() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function setContext($ctx)
|
||||
{
|
||||
$this->ctx = $ctx;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue