mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
parent
1612bdf250
commit
d70730d722
1 changed files with 4 additions and 4 deletions
|
@ -52,7 +52,7 @@ class TreeBehavior extends ModelBehavior {
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $_deletedRow = null;
|
protected $_deletedRow = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initiate Tree behavior
|
* Initiate Tree behavior
|
||||||
|
@ -129,7 +129,7 @@ class TreeBehavior extends ModelBehavior {
|
||||||
'fields' => array($Model->escapeField($left), $Model->escapeField($right)),
|
'fields' => array($Model->escapeField($left), $Model->escapeField($right)),
|
||||||
'recursive' => -1));
|
'recursive' => -1));
|
||||||
if ($data) {
|
if ($data) {
|
||||||
$this->_deletedRow = current($data);
|
$this->_deletedRow[$Model->alias] = current($data);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -144,8 +144,8 @@ class TreeBehavior extends ModelBehavior {
|
||||||
*/
|
*/
|
||||||
public function afterDelete(Model $Model) {
|
public function afterDelete(Model $Model) {
|
||||||
extract($this->settings[$Model->alias]);
|
extract($this->settings[$Model->alias]);
|
||||||
$data = $this->_deletedRow;
|
$data = $this->_deletedRow[$Model->alias];
|
||||||
$this->_deletedRow = null;
|
$this->_deletedRow[$Model->alias] = null;
|
||||||
|
|
||||||
if (!$data[$right] || !$data[$left]) {
|
if (!$data[$right] || !$data[$left]) {
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue