removeCustomAlias() abstract public method

Deletes single custom alias row matched by composite primary key.
abstract public removeCustomAlias ( mixed $parentId, string $textMD5 ) : boolean
$parentId mixed
$textMD5 string
return boolean
コード例 #1
0
 /**
  * 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);
     }
 }
コード例 #2
0
 /**
  * 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;
 }