/**
  * Updates single row data matched by composite primary key.
  *
  * Use optional parameter $languageMaskMatch to additionally limit the query match with languages.
  *
  * @param mixed $parentId
  * @param string $textMD5
  * @param array $values associative array with column names as keys and column values as values
  *
  * @return void
  */
 public function updateRow($parentId, $textMD5, array $values)
 {
     /** @var $query \ezcQueryUpdate */
     $query = $this->dbHandler->createUpdateQuery();
     $query->update($this->dbHandler->quoteTable("ezurlalias_ml"));
     $this->setQueryValues($query, $values);
     $query->where($query->expr->lAnd($query->expr->eq($this->dbHandler->quoteColumn("parent"), $query->bindValue($parentId, null, \PDO::PARAM_INT)), $query->expr->eq($this->dbHandler->quoteColumn("text_md5"), $query->bindValue($textMD5, null, \PDO::PARAM_STR))));
     $query->prepare()->execute();
 }
示例#2
0
 /**
  * Suspend workflow execution.
  *
  * @throws ezcDbException
  */
 protected function doSuspend()
 {
     $query = $this->db->createUpdateQuery();
     $query->update($this->db->quoteIdentifier($this->options['prefix'] . 'execution'))->where($query->expr->eq($this->db->quoteIdentifier('execution_id'), $query->bindValue((int) $this->id)))->set($this->db->quoteIdentifier('execution_variables'), $query->bindValue(ezcWorkflowDatabaseUtil::serialize($this->variables)))->set($this->db->quoteIdentifier('execution_waiting_for'), $query->bindValue(ezcWorkflowDatabaseUtil::serialize($this->waitingFor)))->set($this->db->quoteIdentifier('execution_threads'), $query->bindValue(ezcWorkflowDatabaseUtil::serialize($this->threads)))->set($this->db->quoteIdentifier('execution_next_thread_id'), $query->bindValue((int) $this->nextThreadId));
     $statement = $query->prepare();
     $statement->execute();
     foreach ($this->activatedNodes as $node) {
         $query = $this->db->createInsertQuery();
         $query->insertInto($this->db->quoteIdentifier($this->options['prefix'] . 'execution_state'))->set($this->db->quoteIdentifier('execution_id'), $query->bindValue((int) $this->id))->set($this->db->quoteIdentifier('node_id'), $query->bindValue((int) $node->getId()))->set($this->db->quoteIdentifier('node_state'), $query->bindValue(ezcWorkflowDatabaseUtil::serialize($node->getState())))->set($this->db->quoteIdentifier('node_activated_from'), $query->bindValue(ezcWorkflowDatabaseUtil::serialize($node->getActivatedFrom())))->set($this->db->quoteIdentifier('node_thread_id'), $query->bindValue((int) $node->getThreadId()));
         $statement = $query->prepare();
         $statement->execute();
     }
     $this->db->commit();
 }
 /**
  * Publishes the Type with $typeId from $sourceVersion to $targetVersion,
  * including its fields
  *
  * @param int $typeId
  * @param int $sourceVersion
  * @param int $targetVersion
  *
  * @return void
  */
 public function publishTypeAndFields($typeId, $sourceVersion, $targetVersion)
 {
     $query = $this->dbHandler->createUpdateQuery();
     $query->update($this->dbHandler->quoteTable('ezcontentclass'))->set($this->dbHandler->quoteColumn('version'), $query->bindValue($targetVersion, null, \PDO::PARAM_INT))->where($query->expr->lAnd($query->expr->eq($this->dbHandler->quoteColumn('id'), $query->bindValue($typeId, null, \PDO::PARAM_INT)), $query->expr->eq($this->dbHandler->quoteColumn('version'), $query->bindValue($sourceVersion, null, \PDO::PARAM_INT))));
     $query->prepare()->execute();
     $query = $this->dbHandler->createUpdateQuery();
     $query->update($this->dbHandler->quoteTable('ezcontentclass_classgroup'))->set($this->dbHandler->quoteColumn('contentclass_version'), $query->bindValue($targetVersion, null, \PDO::PARAM_INT))->where($query->expr->lAnd($query->expr->eq($this->dbHandler->quoteColumn('contentclass_id'), $query->bindValue($typeId, null, \PDO::PARAM_INT)), $query->expr->eq($this->dbHandler->quoteColumn('contentclass_version'), $query->bindValue($sourceVersion, null, \PDO::PARAM_INT))));
     $query->prepare()->execute();
     $query = $this->dbHandler->createUpdateQuery();
     $query->update($this->dbHandler->quoteTable('ezcontentclass_attribute'))->set($this->dbHandler->quoteColumn('version'), $query->bindValue($targetVersion, null, \PDO::PARAM_INT))->where($query->expr->lAnd($query->expr->eq($this->dbHandler->quoteColumn('contentclass_id'), $query->bindValue($typeId, null, \PDO::PARAM_INT)), $query->expr->eq($this->dbHandler->quoteColumn('version'), $query->bindValue($sourceVersion, null, \PDO::PARAM_INT))));
     $query->prepare()->execute();
     $query = $this->dbHandler->createUpdateQuery();
     $query->update($this->dbHandler->quoteTable('ezcontentclass_name'))->set($this->dbHandler->quoteColumn('contentclass_version'), $query->bindValue($targetVersion, null, \PDO::PARAM_INT))->where($query->expr->lAnd($query->expr->eq($this->dbHandler->quoteColumn('contentclass_id'), $query->bindValue($typeId, null, \PDO::PARAM_INT)), $query->expr->eq($this->dbHandler->quoteColumn('contentclass_version'), $query->bindValue($sourceVersion, null, \PDO::PARAM_INT))));
     $query->prepare()->execute();
 }