Configuration: ezcConfigurationValidationResult
[ ]
[ ]
[ ]
[ ]
[ ]
Class: ezcConfigurationValidationResult
|
Provides the result of an ezcConfigurationFileReader::validate() operation. [
source]
It contains the result of the validation process. The reader will create the result with location information and the validation items which is returned to the caller.
Instantiate an object of this class and append items using appendItem(). The caller can then access the result using getResultList().
After the reader is done parsing, the validation results can be examined with:
1. echo "Warnings: ", $result->getWarningCount(), "\n";
2. echo "Errors: ", $result->getErrorCount(), "\n";
3. foreach ( $result->getResultList() as $item )
4. {
5. printf( "In '%s' on line '%d', position: '%d': %s\n",
6. $item->file, $item->line, $item->column, $item->details
7. );
8. }
Member Variables
|
public mixed |
$isValid
= true
Holds information on whether the validation process was a success or not, will be true if successful and false if unsuccessful.
The validation process will determine when a configuration is valid, for instance if a stricter validation is run it will set it as invalid even if it contains warnings. |
Method Summary
|
public ezcConfigurationValidationResult |
__construct(
$location, $name, $pathName )
Constructs a validation result |
|
public void |
appendItem(
$item )
Appends the validation item to the result list. |
|
public int |
getErrorCount(
)
Returns the number of errors |
|
public array(ezcConfigurationValidationItem) |
getResultList(
)
Returns a list with validation items |
|
public int |
getWarningCount(
)
Returns the number of warnings |
Methods
__construct
ezcConfigurationValidationResult __construct(
string
$location, string
$name, string
$pathName )
Constructs a validation result
Initializes the validation result with some information on the configuration file and an empty result list.
Parameters
| Name |
Type |
Description |
$location |
string |
The main placement for the configuration as returned by the reader. |
$name |
string |
The name for the configuration as returned by the reader. |
$pathName |
string |
A full path to the file being read by the reader. |
appendItem
Appends the validation item to the result list.
Parameters
getErrorCount
int getErrorCount(
)
Returns the number of errors
getResultList
array(ezcConfigurationValidationItem) getResultList(
)
Returns a list with validation items
getWarningCount
int getWarningCount(
)
Returns the number of warnings
Last updated: Mon, 27 Jul 2009