Rule
[
class tree: Rule
] [
index: Rule
] [
all elements
]
README.txt
Todo List
Packages:
Formagic
Item
Renderer
Rule
Source for file Rule.php
Documentation is available at
Rule.php
<?php
/**
* Formagic
*
* LICENCE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at
* http://formagic.weasle.de/licence.txt
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to licence@weasle.de so we can send you a copy immediately.
*
*
@category
Formagic
*
@package
Rule
*
@author
Florian Sonnenburg
*
@copyright
Copyright (c) 2007 Florian Sonnenburg
*
@license
http://formagic.weasle.de/licence.txt New BSD License
*
@revision
$Revision: 17 $
*/
/**
* FormagicRule abstract superclass
*
*
@category
Formagic
*
@package
Rule
*
@author
Florian Sonnenburg
*
@copyright
Copyright (c) 2007
*
@version
$Id: Rule.php 17 2007-08-19 20:40:10Z meweasle $
***/
abstract
class
Formagic_Rule
{
/**
* Rule type
*
@var
string
*/
protected
$_type
;
/**
* Arguments passed to to rule object
*
@var
array
*/
protected
$_args
;
/**
* Error message
*
@var
mixed
*/
protected
$_errorMessage
=
''
;
/**
* Error code
*
@var
integer
**
*/
protected
$_errorCode
;
/**
* Level of error occured in rule. Can be Formagic::DEBUG, Formagic::NOTICE
* or Formagic::ERROR
*
*
@var
integer
**
*/
protected
$_errorLevel
=
Formagic
::
ERROR
;
/**
* Constructor
*
*
@param
string
$type
*
@param
mixed
$errorMessage
*
@param
array
$args
*
@return
void
***/
public
function
__construct
(
$type
,
$errorMessage
=
null
,
$args
=
null
)
{
$this
->
_type
=
$type
;
if
(
$errorMessage
)
{
$this
->
_errorMessage
=
$errorMessage
;
}
$this
->
_args
=
$args
;
}
/**
* Returns error message of rule
*
*
@return
string
*/
public
function
getMessage
(
)
{
return
$this
->
_errorMessage
;
}
/**
* Returns error code of rule
*
*
@return
*/
public
function
getCode
(
)
{
return
$this
->
_errorCode
;
}
/**
* Returns error level of rule. Default is Formagic::ERROR
*
*
@return
integer
*/
public
function
getLevel
(
)
{
return
$this
->
_errorLevel
;
}
/**
* Returns rule type identification string
*
*
@return
string
*/
public
function
getType
(
)
{
return
$this
->
_type
;
}
/**
* Abstract of main check method. Returns boolean value of check success.
*
* Subclasses have to implement their behaviour here.
*
*
@param
Formagic_Item
$itemObj
*
@return
boolean
***/
abstract
protected
function
check
(
$itemObj
)
;
}
Documentation generated on Thu, 23 Aug 2007 00:29:47 +0200 by
phpDocumentor 1.4.0