historizeBeforeSwap() 추상적인 공개 메소드

Used when swapping Location aliases, this ensures that given $languageMask matches a single entry (database row).
abstract public historizeBeforeSwap ( string $action, integer $languageMask ) : mixed
$action string
$languageMask integer
리턴 mixed
예제 #1
0
 /**
  * Historizes given existing active entries for two swapped Locations.
  *
  * This should be done before republishing URL aliases, in order to avoid unnecessary
  * conflicts when swapped Locations are siblings.
  *
  * We need to historize everything separately per language (mask), in case the entries
  * remain history future publishing reusages need to be able to take them over cleanly.
  *
  * @see \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler::locationSwapped()
  *
  * @param array $location1Entries
  * @param array $location2Entries
  */
 private function historizeBeforeSwap($location1Entries, $location2Entries)
 {
     foreach ($location1Entries as $row) {
         $this->gateway->historizeBeforeSwap($row['action'], $row['lang_mask']);
     }
     foreach ($location2Entries as $row) {
         $this->gateway->historizeBeforeSwap($row['action'], $row['lang_mask']);
     }
 }
 public function historizeBeforeSwap($action, $languageMask)
 {
     try {
         $this->innerGateway->historizeBeforeSwap($action, $languageMask);
     } catch (DBALException $e) {
         throw new \RuntimeException('Database error', 0, $e);
     } catch (PDOException $e) {
         throw new \RuntimeException('Database error', 0, $e);
     }
 }