phplibrary/core/validator/rule/abstract.php
2016-06-29 18:51:32 +03:00

41 lines
711 B
PHP

<?php
abstract class Rule_Abstract
{
public $field;
protected $errorMsg;
protected $ctx;
public function __construct($field, $errorMsg)
{
$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)
{
//
}
public function setContext($ctx)
{
$this->ctx = $ctx;
}
}