insertRow() abstract public method

Inserts new row in urlalias_ml table.
abstract public insertRow ( array $values ) : mixed
$values array
return mixed
 /**
  * Inserts new row in urlalias_ml table.
  *
  * @param array $values
  *
  * @return mixed
  */
 public function insertRow(array $values)
 {
     try {
         return $this->innerGateway->insertRow($values);
     } catch (DBALException $e) {
         throw new \RuntimeException('Database error', 0, $e);
     } catch (PDOException $e) {
         throw new \RuntimeException('Database error', 0, $e);
     }
 }
Beispiel #2
0
 /**
  * Recursively copies aliases from old parent under new parent.
  *
  * @param array $actionMap
  * @param mixed $oldParentAliasId
  * @param mixed $newParentAliasId
  */
 protected function copySubtree($actionMap, $oldParentAliasId, $newParentAliasId)
 {
     $rows = $this->gateway->loadAutogeneratedEntries($oldParentAliasId);
     $newIdsMap = array();
     foreach ($rows as $row) {
         $oldParentAliasId = $row['id'];
         // Ensure that same action entries remain grouped by the same id
         if (!isset($newIdsMap[$oldParentAliasId])) {
             $newIdsMap[$oldParentAliasId] = $this->gateway->getNextId();
         }
         $row['action'] = $actionMap[$row['action']];
         $row['parent'] = $newParentAliasId;
         $row['id'] = $row['link'] = $newIdsMap[$oldParentAliasId];
         $this->gateway->insertRow($row);
         $this->copySubtree($actionMap, $oldParentAliasId, $row['id']);
     }
 }