28 lines
626 B
PHP
28 lines
626 B
PHP
<?php
|
|
|
|
require_once 'abstract.php';
|
|
|
|
/**
|
|
* Проверка на равентство двух полей
|
|
*/
|
|
class Rule_Match extends Rule_Abstract
|
|
{
|
|
public $same;
|
|
|
|
public function getErrorMsg()
|
|
{
|
|
return "Поля не совпадают";
|
|
}
|
|
|
|
/* public function __construct($field, $refField, $errorMsg)
|
|
{
|
|
$this->field = $field;
|
|
$this->refField = $refField;
|
|
$this->errorMsg = $errorMsg;
|
|
}
|
|
*/
|
|
|
|
public function isValid(Collection $container, $status = null) {
|
|
return (strcmp($container->get($this->field), $container->get($this->same)) == 0);
|
|
}
|
|
}
|