• Модуль: lists
  • Путь к файлу: ~/bitrix/modules/lists/lib/controller/element.php
  • Класс: BitrixListsControllerElement
  • Вызов: Element::copyAction
public function copyAction()
{
	$param = $this->getParamFromRequest();
	$params = $param->getParams();

	$this->checkPermission($param, ElementRight::EDIT);
	if ($this->getErrors())
	{
		return null;
	}

	$containerCollection = new ContainerCollection();
	$containerCollection[] = new Container($params["ELEMENT_ID"]);

	$elementImplementer = new ElementImplementer();
	$elementCopier = new EntityCopier($elementImplementer);
	$result = $elementCopier->copy($containerCollection);

	if ($result->getErrors())
	{
		$this->addErrors($result->getErrors());
		return null;

	}
	else
	{
		$resultData = $result->getData();
		return $resultData[$params["ELEMENT_ID"]];
	}
}