Re: [Patch] DB_DataObject - validate()
| From: | Markus Tacker | Date: | Thu, 05 Feb 2004 11:28:41 +0000 |
| Subject: | Re: [Patch] DB_DataObject - validate() | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-25512@lists.php.net to get a copy of this message | ||
/me Wondering where the attached diff has gone...
? ChangeLog
? DB_DataObject.diff
? DataObject
? MDB_DataObjects_notes.txt
? TODO
? docs
? package.xml
? scripts
? tests
Index: DataObject.php
===================================================================
RCS file: /repository/pear/DB_DataObject/DataObject.php,v
retrieving revision 1.217
diff -u -3 -p -u -r1.217 DataObject.php
--- DataObject.php 5 Feb 2004 09:11:11 -0000 1.217
+++ DataObject.php 5 Feb 2004 10:58:54 -0000
@@ -2770,17 +2770,17 @@ Class DB_DataObject extends DB_DataObjec
* you can the use the validate Class from your own methods.
*
* @access public
+ * @param bool Set to true to run validation function on vars which aren't set
* @return array of validation results or true
*/
- function validate()
+ function validate($ifCheckUnset = false)
{
require_once 'Validate.php';
$table = &$this->table();
$ret = array();
foreach($table as $key => $val) {
- // ignore things that are not set. ?
- if (!isset($this->$key)) {
+ if (!isset($this->$key) and !$ifCheckUnset) {
continue;
}
// call user defined validation
--
mit freundlichen Grüßen | Jabber: m@tacker.dyndns.org
m.tacker | ICQ: 9170 9561