Skip to content
Permalink
Browse files

Removing unneeded code for minor optimization

Signed-off-by: Mark Story <mark@mark-story.com>
  • Loading branch information...
ADmad authored and markstory committed Nov 10, 2009
1 parent 64dffb7 commit ad20e43730dd99e5edc3028d6904b3ffb8ce80b6
Showing with 3 additions and 12 deletions.
  1. +3 −12 cake/libs/model/behaviors/tree.php
@@ -28,7 +28,7 @@
* Tree Behavior.
*
* Enables a model object to act as a node-based tree. Using Modified Preorder Tree Traversal
*
*
* @see http://en.wikipedia.org/wiki/Tree_traversal
* @package cake
* @subpackage cake.cake.libs.model.behaviors
@@ -138,15 +138,6 @@ function beforeDelete(&$Model) {
function beforeSave(&$Model) {
extract($this->settings[$Model->alias]);
if (isset($Model->data[$Model->alias][$Model->primaryKey])) {
if ($Model->data[$Model->alias][$Model->primaryKey]) {
if (!$Model->id) {
$Model->id = $Model->data[$Model->alias][$Model->primaryKey];
}
}
unset($Model->data[$Model->alias][$Model->primaryKey]);
}
$this->_addToWhitelist($Model, array($left, $right));
if (!$Model->id) {
if (array_key_exists($parent, $Model->data[$Model->alias]) && $Model->data[$Model->alias][$parent]) {
@@ -616,9 +607,9 @@ function recover(&$Model, $mode = 'parent', $missingParentAction = null) {
* This method does not change the parent of any node.
*
* Requires a valid tree, by default it verifies the tree before beginning.
*
*
* Options:
*
*
* - 'id' id of record to use as top node for reordering
* - 'field' Which field to use in reordeing defaults to displayField
* - 'order' Direction to order either DESC or ASC (defaults to ASC)

0 comments on commit ad20e43

Please sign in to comment.
You can’t perform that action at this time.