blob: 0c6b7de6a9ed66e5cbaba836efc9cdb33fc735a9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
<?php
/**
* TControl, TControlCollection, TEventParameter and INamingContainer class file
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
* @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @package Prado\Web\UI
*/
namespace Prado\Web\UI;
/**
* IValidator interface
*
* If a control wants to validate user input, it must implement this interface.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @package Prado\Web\UI
* @since 3.0
*/
interface IValidator
{
/**
* Validates certain data.
* The implementation of this function should validate certain data
* (e.g. data entered into TTextBox control).
* @return boolean whether the data passes the validation
*/
public function validate();
/**
* @return boolean whether the previous {@link validate()} is successful.
*/
public function getIsValid();
/**
* @param boolean whether the validator validates successfully
*/
public function setIsValid($value);
/**
* @return string error message during last validate
*/
public function getErrorMessage();
/**
* @param string error message for the validation
*/
public function setErrorMessage($value);
}
|