mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-05 19:12:42 +00:00
Removing unneeded code for minor optimization
Signed-off-by: Mark Story <mark@mark-story.com>
This commit is contained in:
parent
64dffb7663
commit
ad20e43730
1 changed files with 3 additions and 12 deletions
|
@ -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 @@ class TreeBehavior extends ModelBehavior {
|
|||
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 @@ class TreeBehavior extends ModelBehavior {
|
|||
* 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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue