eZ\Publish\Core\Search\Elasticsearch\Content\Gateway::delete PHP Method

delete() abstract public method

Deletes a single document of the given $type by given document $id.
abstract public delete ( integer | string $id, string $type )
$id integer | string
$type string
    public abstract function delete($id, $type);

Usage Example

Example #1
0
 /**
  * Deletes a content object from the index
  *
  * @param int $contentId
  * @param int|null $versionId
  *
  * @return void
  */
 public function deleteContent($contentId, $versionId = null)
 {
     if ($versionId === null) {
         $ast = array("query" => array("filtered" => array("filter" => array("and" => array(array("ids" => array("type" => $this->documentTypeName, "values" => array($contentId))))))));
         $this->gateway->deleteByQuery(json_encode($ast), "content");
     } else {
         $this->gateway->delete($contentId, "content");
     }
 }
All Usage Examples Of eZ\Publish\Core\Search\Elasticsearch\Content\Gateway::delete