Перемещает раздел

@api
@param int $dest ID раздела, куда перемещать
@return void
427145
public function move($dest)
    { 
		$tree = new CDBTree('dir_structure');
        $prntid = self::getDbConnection()->fetchColumn('select id from dir_structure where data_id=?', array($dest));
        $strid = self::getDbConnection()->fetchColumn('select id from dir_structure where data_id=?', array($this->id));
		$tree->moveAll($strid, $prntid); 
		
        $this->_url = false;
        $this->_fullUrl = false;
        $this->_treePath = false;
        $this->_path = false;
         
        $this->updateCache();
    }
1207905
private function removeFiles(array $sources, $dest)
    {
        if (is_dir($dest)) {
            foreach ($sources as $source) {
                if (is_dir($source)) {
                    $files = [];
                    list_files($files, $source);
                    foreach ($files as $file) {
                        $file = $dest . DIRECTORY_SEPARATOR . basename($file);
                        if (file_exists($file)) {
                            unlink($file);
                        }
                    }
                }
                else {
                    $file = $dest . DIRECTORY_SEPARATOR . basename($source);
                    if (file_exists($file)) {
                        unlink($file);
                    }
                }
            }
        }
        else {
            if (file_exists($dest)) {
                unlink($dest);
            }
        }
    }
167236
public function setIsEncrypt($isEncrypt)
    {
        if (is_bool($isEncrypt)) {
            $this->_isEncrypt = $isEncrypt;
        } else {
            $this->_isEncrypt = "true" === $isEncrypt;
        }
    }
1109465
public function setDeletedAtDateTime(?DateTime $deletedAt): void
    {
        $this->deleted_at = $deletedAt === null ? null : $deletedAt->format('Y-m-d H:i:s');
    }
16885
public function moveNode(Section $node, Section $dest, $position)
    {
        return $this->_moveNode($node, $dest, $position);
    }
958696
public function put($src, $dest){
		if ( file_exists($src) &&
            ($dest = $this->checkFilePath($dest)) &&
            ftp_put($this->cn,$dest,$src,FTP_BINARY) ){
      return true;
		}
		return false;
	}
200649
protected function copyTemplate($template, $dest)
    {
        $source = __DIR__.'/../../templates/'.$template;
        if (file_exists($source)) {
            return file_put_contents($dest, file_get_contents($source));
        }
    }
422328
public static function copyFrom($src, StreamInterface $dest)
    {
        $srcStream = $src instanceof StreamInterface ? $src : new Stream($src, Stream::MODE_READ_ONLY_FROM_BEGIN);

        static::copy($srcStream, $dest);

        $srcStream->close();
    }
761268
public function checkout($dest)
    {
        $this->wc = new WorkingCopy($this, $dest);

        $this->dispatch(VcsEvents::PRE_CHECKOUT, new CheckoutEventData($this->getHead(), $dest));

        $this->wc->checkout();

        $this->dispatch(VcsEvents::POST_CHECKOUT, new CheckoutEventData($this->getHead(), $dest));
    }
1259259
public static function copy(string $source, string $dest, bool $override = false): void
	{
		if (is_file($source)) {
			self::copyFile($source, $dest, $override);
			return;
		}

		if ( ! is_dir($source)) {
			Helpers::consoleMessage("File or directory '%s' not found.", [$source]);
			return;
		}

		$sourceHandle = opendir($source);

		if ( ! $sourceHandle) {
			throw new SynchronizerException('Failed to copy directory: failed to open source ' . $source);
		}

		while ($file = readdir($sourceHandle)) {
			if (in_array($file, ['.', '..'], true)) {
				continue;
			}

			if (is_dir($source . '/' . $file)) {
				if ( ! file_exists($dest . '/' . $file)) {
					self::createDirectory($dest);
				}

				$file .= '/';
				self::copy($source .  $file, $dest . $file, $override);

			} else {
				$dest = rtrim($dest, '/') . '/';
				$source = rtrim($source, '/') . '/';
				self::copyFile($source . $file, $dest . $file, $override);
			}
		}
	}
700072
protected function preserveAlpha($dest, $src)
    {
        $transparent = @imagecolortransparent($src);
        if (-1 != $transparent) {
            $color = @imagecolorsforindex($src, $transparent);
            $allocated = @imagecolorallocatealpha(
                            $dest
                            , $color['red']
                            , $color['green']
                            , $color['blue']
                            , $color['alpha']
            );
            @imagecolortransparent($dest, $allocated);
            @imagefill($dest, 0, 0, $allocated);
        }
    }
361957
protected function insertNode($destLeft, $destRight, $destRoot=null)
    {
        $this->setLeftValue($destLeft);
        $this->setRightValue($destRight);
        if($this->hasManyRoots())
        {
            $this->setRootValue($destRoot);
        }
        $this->getManager()->getEntityManager()->persist($this->getNode());
    }
996835
public static function copyRecDir($source, $dest) {
    if (!is_dir($dest)) {
      self::mkdirRec($dest);
    }
    $dir = opendir($source);
    while ($file = readdir($dir)) {
      if ($file == "." || $file == "..") {
        continue;
      }
      self::copyRec("$source/$file", "$dest/$file");
    }
    closedir($dir);
  }
407810
static function rename($src, $dest) {
        if (self::exists($dest)) {
            throw new \Lollipop\Exception\Runtime('File already exists: ' . $dest);
        }
        
        if (is_uploaded_file($src)) {
            return \move_uploaded_file($src, $dest);
        }
        
        return \rename($src, $dest);
    }
1152393
public function ips($ips = '*')
    {
        $ips = $this->redis->keys($this->keys->ip($ips));

        if (count($ips)) {
            $this->redis->del($ips);
        }
    }
1007894
public function setOrder($field, $desc = null)
    {
        if (!$field instanceof Field) {
            if (is_object($field)) {
                $this->_dsql()->order($field, $desc);

                return $this;
            }

            if (is_string($field) && strpos($field, ',') !== false) {
                $field = explode(',', $field);
            }
            if (is_array($field)) {
                if (!is_null($desc)) {
                    throw $this->exception('If first argument is array, second argument must not be used');
                }

                foreach (array_reverse($field) as $o) {
                    $this->setOrder($o);
                }

                return $this;
            }

            if (is_null($desc) && is_string($field) && strpos($field, ' ') !== false) {
                list($field, $desc) = array_map('trim', explode(' ', trim($field), 2));
            }

            /** @type Field $field */
            $field = $this->getElement($field);
        }

        $this->_dsql()->order($field, $desc);

        return $this;
    }
1004814
protected function updateNode($destLeft)
    {
        $left = $this->getLeftValue();
        $right = $this->getRightValue();
        $root = $this->hasManyRoots() ? $this->getRootValue() : null;

        $treeSize = $right - $left + 1;

        // Make room in the new branch
        $this->shiftRLRange($destLeft, 0, $treeSize, $root);

        if($left >= $destLeft)
        {
            // src was shifted too
            $left += $treeSize;
            $right += $treeSize;
        }

        // Now there's enough room next to target to move the subtree
        $this->shiftRLRange($left, $right, $destLeft - $left, $root);

        // Correct values after source (close gap in old tree)
        $this->shiftRLRange($right + 1, 0, -$treeSize, $root);
    }