Copies a resource

@return string HTML output
776146
public function copy()
	{
		$view = $this->getView();

		$view->bundleData = $this->toArray( $view->item, true );
		$view->bundleBody = '';

		foreach( $this->getSubClients() as $client ) {
			$view->bundleBody .= $client->copy();
		}

		return $this->render( $view );
	}
786066
private function copySourceContent()
    {
        // Move plugin to Plugin's directory
        $this->info("Copying source to plugins directory");
        $this->pluginNamespace = str_replace('\\', '/', $this->configContent->namespace);

        if(file_exists(pluginsPath($this->pluginNamespace))) {
            $this->cleanTmp();
            throw new \Exception('A plugin with the same namespace already exists in plugins directory');
        }

        // Created organisation directory if it doesn't exist
        $explodeNamespace = explode('/', $this->pluginNamespace);
        if(!file_exists(pluginsPath($explodeNamespace[0]))) {
            File::makeDirectory(pluginsPath($explodeNamespace[0]), 0755, true);
        }

        // Delete created directory if rename can not be executed
        if(!File::move($this->tmpDirectory, pluginsPath($this->pluginNamespace))) {
            $this->cleanTmp();
            throw new \Exception('Source could not be moved to plugins directory!');
        }

        return $this;
    }
738180
private function copyRoutesAndProvider()
    {
        // copy ROUTES
        $this->copyFilesFromSource($this->basePath . "routes", base_path("routes"));

        // copy RouteServiceProvider
        $source = $this->appPath . "Providers{$this->ds}RouteServiceProvider.php";
        $this->copyFilesFromSource($source, app_path('Providers'), "namespace Bpocallaghan\Titan", "namespace App");
    }
443124
public function copy()
    {
        $list = [];
        foreach ($this->getIterator() as $key => $value) {
            $list[$key] = \is_object($value) ? clone $value : $value;
        }

        return $this->createFrom($list);
    }
41722
public function copy()
	{
		$view = $this->getView();

		$view->subscriptionData = $this->toArray( $view->item, true );
		$view->subscriptionBody = '';

		foreach( $this->getSubClients() as $client ) {
			$view->subscriptionBody .= $client->copy();
		}

		return $this->render( $view );
	}
1058002
public function copy()
	{
		$view = $this->addViewData( $this->getView() );

		$view->stockData = $this->toArray( $view->item, true );
		$view->stockBody = '';

		foreach( $this->getSubClients() as $client ) {
			$view->stockBody .= $client->copy();
		}

		return $this->render( $view );
	}
937229
private function copy(File $resource, ResourceNode $destParent)
    {
        $ds = DIRECTORY_SEPARATOR;
        $workspace = $destParent->getWorkspace();
        $newFile = new File();
        $newFile->setSize($resource->getSize());
        $newFile->setName($resource->getName());
        $newFile->setMimeType($resource->getMimeType());
        $hashName =  'WORKSPACE_' . $workspace->getId() .
            $ds .
            $this->container->get('claroline.utilities.misc')->generateGuid() .
            '.' .
            pathinfo($resource->getHashName(), PATHINFO_EXTENSION);
        $newFile->setHashName($hashName);
        $filePath = $this->container->getParameter('claroline.param.files_directory') . $ds . $resource->getHashName();
        $newPath = $this->container->getParameter('claroline.param.files_directory') . $ds . $hashName;
        $workspaceDir = $this->filesDir . $ds . 'WORKSPACE_' . $workspace->getId();

        if (!is_dir($workspaceDir)) {
            mkdir($workspaceDir);
        }
        copy($filePath, $newPath);

        return $newFile;
    }
448475
protected function loadCopy()
    {
        $copy = @file_get_contents($this->path . '/README.md');

        if ($copy) {
            $this->copy = Markdown::defaultTransform($copy);
        } else {
            $this->copy = false;
        }
    }
226409
public function serialize()
    {
        $output = [];
        foreach ($this as $element) {
            $proxy = $element->getProxy();
            $output[] = $proxy->getContenttype() . '/' . $proxy->getSlug();
        }

        return $output;
    }
1272735
public function copy()
	{
		$view = $this->getView();

		$view->variantData = $this->toArray( $view->item, true );
		$view->variantBody = '';

		foreach( $this->getSubClients() as $client ) {
			$view->variantBody .= $client->copy();
		}

		return $this->render( $view );
	}
150512
function createResources() {
    if( 0 >= count( $this->resources ))
      return;
    $output = null;
    foreach( $this->resources as $resource ) {
      $attributes = $this->_createParams( $resource['params'], array( 'ALTREP', 'LANGUAGE' ));
      if( is_array( $resource['value'] )) {
        foreach( $resource['value'] as $rix => $resourcePart )
          $resource['value'][$rix] = $this->_strrep( $resourcePart );
        $content  = implode( ',', $resource['value'] );
      }
      else
        $content  = $this->_strrep( $resource['value'] );
      $output    .= $this->_createElement( 'RESOURCES', $attributes, $content );
    }
    return $output;
  }
947436
private function copySourceContent()
    {
        // Move plugin to Plugin's directory
        $this->info("Copying source to plugins directory");
        $this->pluginNamespace = str_replace('\\', '/', $this->configContent->namespace);

        // Delete current plugin directory
        File::deleteDirectory(pluginsPath($this->pluginNamespace));

        // Delete created directory if rename can not be executed
        if(!File::move($this->tmpDirectory, pluginsPath($this->pluginNamespace))) {
            $this->cleanTmp();
            throw new \Exception('Source could not be moved to plugins directory!');
        }

        return $this;
    }
598932
public function copy()
	{
		$view = $this->getView();

		$view->attributeData = $this->toArray( $view->item, true );
		$view->attributeBody = '';

		foreach( $this->getSubClients() as $client ) {
			$view->attributeBody .= $client->copy();
		}

		return $this->render( $view );
	}
162914
public function performReadonlyTransformation()
    {
        /** @var ReadonlyTagField $copy */
        $copy = $this->castedCopy(ReadonlyTagField::class);
        $copy->setSourceList($this->getSourceList());
        return $copy;
    }
498121
public function sendContent()
	{
		if (! $this->isSuccessful()) {
			return parent::sendContent();
		}
		
		if (0 === $this->maxlen) {
			return $this;
		}
		
		$out = fopen('php://output', 'wb');
		$in = $this->resource->getStream();
		
		stream_copy_to_stream($in, $out, $this->maxlen, $this->offset);
		
		fclose($out);
		fclose($in);
		
		return $this;
	}
671226
public function copy()
	{
		$class = __NAMESPACE__ . '\\Scaffolding\\' . ucfirst($this->type);

		if (class_exists($class))
		{
			$obj = new $class($this->output, $this->arguments);
		}
		else
		{
			if (empty($this->type))
			{
				$this->output->error('Error: Sorry, scaffolding can\'t copy nothing. Try telling it what you want to copy.');
			}
			else
			{
				$this->output->error('Error: Sorry, scaffolding doesn\'t know how to copy a ' . $this->type);
			}
		}

		if (!method_exists($obj, 'doCopy'))
		{
			$this->output->error('Error: scaffolding doesn\'t know how to copy a ' . $this->type);
		}

		// Do the actual copy
		$obj->doCopy();
	}
91218
private function copy(File $resource, File $file)
    {
        $ds = DIRECTORY_SEPARATOR;
        $hash = $this->getHash($resource);

        $file->setSize($resource->getSize());
        $file->setName($resource->getName());
        $file->setMimeType($resource->getMimeType());
        $file->setHashName($hash);
        copy($this->filesDir.$ds.$resource->getHashName(), $this->filesDir.$ds.$hash);

        return $file;
    }