Documentation

markDeletedBlock

Attention! We strongly recommend first to learn more about REST documentation for Sites module to understand how the module functions (with REST available in Bitrix24 Self-hosted editions). View this documentation as useful source when working with Bitrix24 Self-hosted editions.

public function markDeletedBlock(
   $id,
   $mark
)

Marks block as deleted/not deleted. Blocks marked as deleted continue to exist in the database, but do not present in page instance. Except when the object is especially initialized with deleted blocks.

Parameters

Class Description Available from version
$id Block ID, located at this page. Note the page handling mode, if its draft or not, these are different sets of blocks.
$mark true - by default (mark as deleted) / false (remove marking)

Example

if (\Bitrix\Main\Loader::includeModule('landing'))
{
   \Bitrix\Landing\Landing::setEditMode(true);

   $landing = \Bitrix\Landing\Landing::createInstance(
      1
   );
   if ($landing->exist())
   {
      var_dump($landing->markDeletedBlock(26, true));
   }
   
   foreach ($landing->getError()->getErrors() as $error)
   {
      echo $error->getCode() . ': ';
      echo $error->getMessage();
      echo "\n";
   }
}


© «Bitrix24», 2001-2024
Up