svn: /pear/packages/DB_DataObject/trunk/ DataObject.php

From: Date: Mon, 21 Nov 2011 09:05:26 +0000
Subject: svn: /pear/packages/DB_DataObject/trunk/ DataObject.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-62771@lists.php.net to get a copy of this message
alan_k Mon, 21 Nov 2011 09:05:26 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=319603 Log: move assignment to error in raiseError after it actually happens, this should ensure _lastError gets set correctly as the aliased setting does not appear to work very well.. Changed paths: U pear/packages/DB_DataObject/trunk/DataObject.php Modified: pear/packages/DB_DataObject/trunk/DataObject.php =================================================================== --- pear/packages/DB_DataObject/trunk/DataObject.php 2011-11-21 08:55:58 UTC (rev 319602) +++ pear/packages/DB_DataObject/trunk/DataObject.php 2011-11-21 09:05:26 UTC (rev 319603) @@ -315,7 +315,7 @@ /** * An autoloading, caching static get method using key, value (based on get) - * (deprecated - use ::get / and your own caching method) + * (depreciated - use ::get / and your own caching method) * * Usage: * $object = DB_DataObject::staticGet("DbTable_mytable",12); @@ -2731,7 +2731,7 @@ /** * autoload Class relating to a table - * (deprecated - use ::factory) + * (depreciated - use ::factory) * * @param string $table table * @access private @@ -3137,7 +3137,7 @@ // this is the autonaming stuff.. // it sends the column name down to getLink and lets that sort it out.. // if there is a links file then it is not used! - // IT IS DEPRECATED!!!! - USE + // IT IS DEPRECIATED!!!! - USE if (!is_null($links)) { return false; } @@ -3165,7 +3165,7 @@ * into a static property named <dbname>.links and specifies the table joins, * the other is highly dependant on naming columns 'correctly' :) * - * NOTE: the naming convention is deprecated!!! - use links.ini + * NOTE: the naming convention is depreciated!!! - use links.ini * * using colname = xxxxx_yyyyyy * xxxxxx = related table; (yyyyy = user defined..) @@ -4562,15 +4562,7 @@ } $error = &PEAR::getStaticProperty('DB_DataObject','lastError'); - // this will never work totally with PHP's object model. - // as this is passed on static calls (like staticGet in our case) - - if (isset($this) && is_object($this) && is_subclass_of($this,'db_dataobject')) { - $this->_lastError = $error; - } - - $_DB_DATAOBJECT['LASTERROR'] = $error; - + // no checks for production here?....... - we log errors before we throw them. DB_DataObject::debug($message,'ERROR',1); @@ -4583,6 +4575,14 @@ $opts=null, $userinfo=null, 'DB_DataObject_Error' ); } + // this will never work totally with PHP's object model. + // as this is passed on static calls (like staticGet in our case) + + $_DB_DATAOBJECT['LASTERROR'] = $error; + + if (isset($this) && is_object($this) && is_subclass_of($this,'db_dataobject')) { + $this->_lastError = $error; + } return $error; }

« previous php.pear.cvs (#62771) next »