cvs: pear /DB_NestedSet NestedSet.php
| From: | Daniel Khan | Date: | Tue, 09 Sep 2003 23:19:12 +0000 |
| Subject: | cvs: pear /DB_NestedSet NestedSet.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-12593@lists.php.net to get a copy of this message | ||
datenpunk Tue Sep 9 19:19:12 2003 EDT
Modified files:
/pear/DB_NestedSet NestedSet.php
Log:
- Moved pickNode calls which are only needed by event listeners into the newly added condition
Index: pear/DB_NestedSet/NestedSet.php
diff -u pear/DB_NestedSet/NestedSet.php:1.37 pear/DB_NestedSet/NestedSet.php:1.38
--- pear/DB_NestedSet/NestedSet.php:1.37 Tue Sep 9 19:06:14 2003
+++ pear/DB_NestedSet/NestedSet.php Tue Sep 9 19:19:12 2003
@@ -16,7 +16,7 @@
// | Authors: Daniel Khan <dk@webcluster.at> |
// | Jason Rust <jason@rustyparts.com> |
// +----------------------------------------------------------------------+
-// $Id: NestedSet.php,v 1.37 2003/09/09 23:06:14 datenpunk Exp $
+// $Id: NestedSet.php,v 1.38 2003/09/09 23:19:12 datenpunk Exp $
//
// CREDITS:
@@ -59,7 +59,7 @@
*
* @author Daniel Khan <dk@webcluster.at>
* @package DB_NestedSet
-* @version $Revision: 1.37 $
+* @version $Revision: 1.38 $
* @access public
*/
@@ -935,9 +935,9 @@
$res = $this->db->query($sql);
$this->_testFatalAbort($res, __FILE__, __LINE__);
- // EVENT (nodeCreate)
- $thisnode = &$this->pickNode($node_id);
if (!$this->skipCallbacks &&
isset($this->_hasListeners['nodeCreate'])) {
+ // EVENT (nodeCreate)
+ $thisnode = &$this->pickNode($node_id);
$this->triggerEvent('nodeCreate', $thisnode);
}
return $node_id;
@@ -1034,9 +1034,9 @@
$res = $this->db->query($sql);
$this->_testFatalAbort($res, __FILE__, __LINE__);
- // EVENT (NodeCreate)
- $thisnode = $this->pickNode($node_id);
if (!$this->skipCallbacks &&
isset($this->_hasListeners['nodeCreate'])) {
+ // EVENT (NodeCreate)
+ $thisnode = $this->pickNode($node_id);
$this->triggerEvent('nodeCreate', $thisnode);
}
return $node_id;
@@ -1136,9 +1136,9 @@
$res = $this->db->query($sql);
$this->_testFatalAbort($res, __FILE__, __LINE__);
- // EVENT (NodeCreate)
- $thisnode =& $this->pickNode($node_id);
if (!$this->skipCallbacks &&
isset($this->_hasListeners['nodeCreate'])) {
+ // EVENT (NodeCreate)
+ $thisnode =& $this->pickNode($node_id);
$this->triggerEvent('nodeCreate', $thisnode);
}
return $node_id;
@@ -1247,8 +1247,9 @@
return false;
}
- $eparams = array('values' => $values);
+
if (!$this->skipCallbacks &&
isset($this->_hasListeners['nodeUpdate'])) {
+ $eparams = array('values' => $values);
// EVENT (NodeUpdate)
$this->triggerEvent('nodeUpdate', $thisnode, $eparams);
}
@@ -1506,10 +1507,11 @@
foreach($relations AS $key => $val) {
$clone = $this->pickNode($val);
if ($copy) {
- // EVENT (NodeCopy)
- $thisnode =& $this->pickNode($key);
- $eparams = array('clone' => $clone);
+
if (!$this->skipCallbacks &&
isset($this->_hasListeners['nodeCopy'])) {
+ // EVENT (NodeCopy)
+ $thisnode =& $this->pickNode($key);
+ $eparams = array('clone' => $clone);
$this->triggerEvent('nodeCopy', $thisnode, $eparams);
}
continue;
@@ -2168,7 +2170,7 @@
* Generic class for node objects
*
* @autor Daniel Khan <dk@webcluster.at>;
-* @version $Revision: 1.37 $
+* @version $Revision: 1.38 $
* @package DB_NestedSet
*
* @access private