public function moveDown($entity) {
		extract($this->_config);
		$next = $model::find('first', [
					'conditions' => [
						$parent => $entity->$parent,
						$left => $entity->$right + 1
				]]);

		if ($next !== null) {
			$spanToZero = $entity->$right;
			$rangeX = ['floor' => $entity->$left, 'ceiling' => $entity->$right];
			$shiftX = ($next->$right - $next->$left) + 1;
			$rangeY = ['floor' => $next->$left, 'ceiling' => $next->$right];
			$shiftY = ($entity->$right - $entity->$left) + 1;

			$this->_updateBetween($rangeX, '-', $spanToZero, $this->_scope($entity));
			$this->_updateBetween($rangeY, '-', $shiftY, $this->_scope($entity));
			$this->_updateBetween([
				'floor' => (0 - $shiftY), 'ceiling' => 0
			], '+', $spanToZero + $shiftX, $this->_scope($entity));

			$entity->set([
				$left => $entity->$left + $shiftX, $right => $entity->$right + $shiftX
			]);
		}
		return true;
	}
public function moveDown($entity) {
		extract($this->_config);
		$next = $model::find('first', [
					'conditions' => [
						$parent => $entity->$parent,
						$left => $entity->$right + 1
				]]);

		if ($next !== null) {
			$spanToZero = $entity->$right;
			$rangeX = ['floor' => $entity->$left, 'ceiling' => $entity->$right];
			$shiftX = ($next->$right - $next->$left) + 1;
			$rangeY = ['floor' => $next->$left, 'ceiling' => $next->$right];
			$shiftY = ($entity->$right - $entity->$left) + 1;

			$this->_updateBetween($rangeX, '-', $spanToZero, $this->_scope($entity));
			$this->_updateBetween($rangeY, '-', $shiftY, $this->_scope($entity));
			$this->_updateBetween([
				'floor' => (0 - $shiftY), 'ceiling' => 0
			], '+', $spanToZero + $shiftX, $this->_scope($entity));

			$entity->set([
				$left => $entity->$left + $shiftX, $right => $entity->$right + $shiftX
			]);
		}
		return true;
	}
public function moveDown ( $ entity ) { extract ( $ this -> _config ) ; $ next = $ model :: find ( 'first' , [ 'conditions' => [ $ parent => $ entity -> $ parent , $ left => $ entity -> $ right + 1 ] ] ) ; if ( $ next !== null ) { $ spanToZero = $ entity -> $ right ; $ rangeX = [ 'floor' => $ entity -> $ left , 'ceiling' => $ entity -> $ right ] ; $ shiftX = ( $ next -> $ right - $ next -> $ left ) + 1 ; $ rangeY = [ 'floor' => $ next -> $ left , 'ceiling' => $ next -> $ right ] ; $ shiftY = ( $ entity -> $ right - $ entity -> $ left ) + 1 ; $ this -> _updateBetween ( $ rangeX , '-' , $ spanToZero , $ this -> _scope ( $ entity ) ) ; $ this -> _updateBetween ( $ rangeY , '-' , $ shiftY , $ this -> _scope ( $ entity ) ) ; $ this -> _updateBetween ( [ 'floor' => ( 0 - $ shiftY ) , 'ceiling' => 0 ] , '+' , $ spanToZero + $ shiftX , $ this -> _scope ( $ entity ) ) ; $ entity -> set ( [ $ left => $ entity -> $ left + $ shiftX , $ right => $ entity -> $ right + $ shiftX ] ) ; } return true ; }
Moves an element down in order

@param object $entity The Entity to move down
Moves an element down in order