/** * Deletes single custom alias row matched by composite primary key. * * If $id is set only autogenerated entries will be removed. * * @param mixed $parentId * @param string $textMD5 * * @return bool */ public function removeCustomAlias($parentId, $textMD5) { try { return $this->innerGateway->removeCustomAlias($parentId, $textMD5); } catch (DBALException $e) { throw new \RuntimeException('Database error', 0, $e); } catch (PDOException $e) { throw new \RuntimeException('Database error', 0, $e); } }
/** * Removes url aliases. * * Autogenerated aliases are not removed by this method. * * @param \eZ\Publish\SPI\Persistence\Content\UrlAlias[] $urlAliases * * @return bool */ public function removeURLAliases(array $urlAliases) { foreach ($urlAliases as $urlAlias) { if ($urlAlias->isCustom) { list($parentId, $textMD5) = explode('-', $urlAlias->id); if (!$this->gateway->removeCustomAlias($parentId, $textMD5)) { return false; } } } return true; }