Deletes any content imported by this module.

@return $this
9485
public function deleteImportedContent() {
    $uuids = $this->state->get('govcms8_default_content_uuids', []);
    $by_entity_type = array_reduce(array_keys($uuids), function ($carry, $uuid) use ($uuids) {
      $entity_type_id = $uuids[$uuid];
      $carry[$entity_type_id][] = $uuid;
      return $carry;
    }, []);
    foreach ($by_entity_type as $entity_type_id => $entity_uuids) {
      $storage = $this->entityTypeManager->getStorage($entity_type_id);
      $entities = $storage->loadByProperties(['uuid' => $entity_uuids]);
      $storage->delete($entities);
    }
    return $this;
  }
397936
public function discard()
    {
        $args = func_get_args();
        $this->discards = array_merge($this->discards, $this->args_to_array($args));

        return $this;
    }
8474
public function removeAll()
    {
        foreach ($this->getProfiles() as $profile => $child) {
            $this->remove($profile);
        }

        return $this;
    }
942191
public function clean()
    {
        $directory = scandir($this->path);

        if (!empty($directory)) {
            foreach ($directory as $item) {
                if ($item !== '.' && $item !== '..') {
                    $this->remove($item);
                }
            }
        }

        return $this;
    }
877034
public function clear()
  {
    $this->_object = $this->_changed = $this->_operations = $this->_dirty = $this->_related_objects = array();
    $this->_loaded = NULL;
    return $this;
  }
377362
public function delete()
    {
        $rawContent = $this->getRawContent();
        $filePath   = $this->attributes['file_path'];
        $logContent = file_get_contents($filePath);
        $logContent = str_replace($rawContent, '', $logContent);

        file_put_contents($filePath, $logContent);

        return true;
    }
971962
public function withTrashed()
    {
        $this->withTrashed = true;

        $this->query = $this->useWithTrashed($this->query);

        return $this;
    }
1095081
function removeThis()
    {
        $contentobjectID = $this->attribute( 'contentobject_id' );
        $versionNum = $this->attribute( 'version' );

        $db = eZDB::instance();
        $db->begin();

        // Ensure no one else deletes this version while we are doing it.
        $db->query( 'SELECT * FROM ezcontentobject_version
                         WHERE id=' . $this->attribute( 'id' ) . ' FOR UPDATE' );

        $contentObjectTranslations = $this->translations();

        foreach ( $contentObjectTranslations as $contentObjectTranslation )
        {
            /** @var eZContentObjectAttribute $attribute */
            foreach ( $contentObjectTranslation->objectAttributes() as $attribute )
            {
                $attribute->removeThis( $attribute->attribute( 'id' ), $versionNum );
            }
        }
        $db->query( "DELETE FROM ezcontentobject_link
                         WHERE from_contentobject_id=$contentobjectID AND from_contentobject_version=$versionNum" );
        $db->query( "DELETE FROM eznode_assignment
                         WHERE contentobject_id=$contentobjectID AND contentobject_version=$versionNum" );

        $db->query( 'DELETE FROM ezcontentobject_version
                         WHERE id=' . $this->attribute( 'id' ) );

        $contentobject = $this->attribute( 'contentobject' );
        if ( is_object( $contentobject ) )
        {
            if ( !$contentobject->hasRemainingVersions() )
            {
                $contentobject->purge();
            }
            else
            {
                $version = $contentobject->CurrentVersion;
                if ( $contentobject->CurrentVersion == $versionNum ) //will assign another current_version in contentObject.
                {
                   //search for version that will be current after removing of this one.
                   $candidateToBeCurrent = $db->arrayQuery( "SELECT version
                                                     FROM ezcontentobject_version
                                                     WHERE contentobject_id={$contentobject->ID} AND
                                                           version!={$contentobject->CurrentVersion}
                                                     ORDER BY modified DESC",
                                                 array( 'offset' => 0, 'limit' => 1 ) );

                   if ( isset($candidateToBeCurrent[0]['version']) && is_numeric($candidateToBeCurrent[0]['version']) )
                   {
                       $contentobject->CurrentVersion = $candidateToBeCurrent[0]['version'];
                       $contentobject->store();
                   }
               }
            }
        }
        $db->query( "DELETE FROM ezcontentobject_name
                         WHERE contentobject_id=$contentobjectID AND content_version=$versionNum" );

        $db->commit();
    }
1305714
public function clear()
    {
        foreach ($this->filesystem()->listContents() as $file) {
            $this->filesystem()->delete($file['path']);
        }

        return true;
    }
635756
public function clear()
    {
        if (!self::$session) {
            Exception::i()->setMessage(self::ERROR_NOT_STARTED)->trigger();
        }

        $_SESSION = array();

        return $this;
    }
791723
public function removeProcessed()
    {
        if ( $this->hasAttribute( 'action' ) )
        {
            unset( $this->attributes['action'] );
        }

        if ( $this->getBlockCount() > 0 )
        {
            foreach ( $this->attributes['blocks'] as $index => $block )
            {
                if ( $block->toBeRemoved() )
                {
                    $this->removeBlock( $index );
                }
                else
                {
                    $block->removeProcessed();
                }
            }
        }

        return $this;
    }
721404
function removeThis()
    {
        $exportItems = $this->fetchItems();

        $db = eZDB::instance();
        $db->begin();
        foreach ( $exportItems as $item )
        {
            $item->remove();
        }
        $this->remove();
        $db->commit();
    }
384624
private function removeEmptySections()
    {
        $sections = [$this::IMPORTS_SECTION, $this::SERVICE_SECTION];
        foreach ($sections as $section) {
            if (array_key_exists($section, $this->configArray) &&
                (!$this->configArray[$section] || !count($this->configArray[$section]))) {
                unset($this->configArray[$section]);
            }
        }
    }
516439
public function deleteAll() {
        $tags = $this->read();

        $ids = [];

        foreach ($tags as $tag) {
            $ids[] = $tag['id'];
        }

        if (count($ids) > 0) {
            $this->batchDelete($ids);
        }

        return $this;
    }
1199685
public function clear()
    {
        $this->clearCountryCode();
        $this->clearNationalNumber();
        $this->clearExtension();
        $this->clearItalianLeadingZero();
        $this->clearNumberOfLeadingZeros();
        $this->clearRawInput();
        $this->clearCountryCodeSource();
        $this->clearPreferredDomesticCarrierCode();
        return $this;
    }
730202
public function resetContents()
    {
        $this->setImports( array() )
             ->setRules( array() );

        if ( $this->hasExtraContent() )
        {
            $this->setExtraContent( null );
        }

        return $this;
    }
7751
public function unregister()
    {
        $this->files->unregister();
        $this->psr0->unregister();
        $this->psr4->unregister();

        return $this;
    }