public static function copy($srcObject, $srcId, $destObject, $destId)
    {
        $i = 0;
        //kopiowanie plików
        foreach (CmsFileQuery::byObject($srcObject, $srcId)->find() as $file) {
            try {
                //tworzenie kopii
                $copy = new \Mmi\Http\RequestFile([
                    'name' => $file->original,
                    'tmp_name' => $file->getRealPath(),
                    'size' => $file->size
                ]);
            } catch (\Mmi\App\KernelException $e) {
                \Mmi\App\FrontController::getInstance()->getLogger()->warning('Unable to copy file, file not found: ' . $file->getRealPath());
                continue;
            }
            $newFile = clone $file;
            $newFile->id = null;
            //dołączanie pliku
            self::_copyFile($copy, $destObject, $destId, $newFile);
            $i++;
        }
        return $i;
    }