Pluf_Error Class Reference

List of all members.

Public Member Functions

 resetError ()
 setError ($msg, $no=0)
 error ($html=false, $with_nb=true)
 setDbError ($db_error_msg)
 bulkSetError ($errors)

Private Attributes

 $error = array()


Detailed Description

Error handling class.

Basis idea from Olivier Meunier


Member Function Documentation

Pluf_Error::resetError (  ) 

Reset the errors

Pluf_Error::setError ( msg,
no = 0 
)

Set an error.

By convention the number is 4xx if the error is coming from the user or 5xx if coming from the system (database error for ex.)

Parameters:
string Error message
int Error number (0)

Pluf_Error::error ( html = false,
with_nb = true 
)

Returns the errors.

Parameters:
bool Errors as HTML list (false)
bool Show numbers (true)
Returns:
mixed array of errors, HTML list, or false if no errors

Pluf_Error::setDbError ( db_error_msg  ) 

Helper function to set the error from the DB.

Parameters:
string Error message from the DB

Pluf_Error::bulkSetError ( errors  ) 

Bulk set errors.

Used when you went to recopy the errors of one object into another. You can call that way: $object->bulkSetErrors($otherobject->error());

Parameters:
array List of errors
Returns:
bool Success


Member Data Documentation

Pluf_Error::$error = array() [private]

Current errors.


The documentation for this class was generated from the following file:

Generated on Wed Feb 3 15:44:52 2010 for Pluf by  doxygen