Core
3.2
PHP API documentation
Main Page
Related Pages
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Pages
CheckData.php
Go to the documentation of this file.
1
<?php
2
/*
3
* @author Anakeen
4
* @package FDL
5
*/
6
7
abstract
class
CheckData
8
{
9
/**
10
* @var array
11
*/
12
protected
$errors
= array();
13
/**
14
* call it after check to see error message
15
* @return string error message
16
*/
17
public
function
getErrors
()
18
{
19
return
implode(
"\n"
, $this->errors);
20
}
21
/**
22
* call it after check to see if error occurs
23
* @return bool
24
*/
25
public
function
hasErrors
()
26
{
27
return
count($this->errors) > 0;
28
}
29
public
function
addError
($msg)
30
{
31
if
($msg) {
32
33
if
(!in_array($msg, $this->errors)) {
34
$this->errors[] = $msg;
35
error_log(
"ERROR:"
. $msg);
36
}
37
}
38
}
39
/**
40
* @abstract
41
* @param array $data
42
* @param null $extra
43
* @return CheckData this itself
44
*/
45
public
abstract
function
check
(array
$data
, &$extra = null);
46
}
CheckData\getErrors
getErrors()
Definition:
CheckData.php:17
CheckData
Definition:
CheckData.php:7
CheckData\addError
addError($msg)
Definition:
CheckData.php:29
CheckData\check
check(array $data, &$extra=null)
CheckData\hasErrors
hasErrors()
Definition:
CheckData.php:25
$data
$data
Definition:
fdl_sendmail.php:40
CheckData\$errors
$errors
Definition:
CheckData.php:12
← centre documentaire
© anakeen