eZ\Publish\Core\Persistence\Database\DatabaseHandler::getAutoIncrementValue PHP Метод

getAutoIncrementValue() публичный Метод

Returns the value used for autoincrement tables. Usually this will just be null. In case for sequence based RDBMS this method can return a proper value for the given column.
public getAutoIncrementValue ( string $table, string $column ) : mixed
$table string
$column string
Результат mixed
    public function getAutoIncrementValue($table, $column);

Usage Example

Пример #1
0
 /**
  * Inserts the given UrlWildcard.
  *
  * @param \eZ\Publish\SPI\Persistence\Content\UrlWildcard $urlWildcard
  *
  * @return mixed
  */
 public function insertUrlWildcard(UrlWildcard $urlWildcard)
 {
     /** @var $query \eZ\Publish\Core\Persistence\Database\InsertQuery */
     $query = $this->dbHandler->createInsertQuery();
     $query->insertInto($this->dbHandler->quoteTable('ezurlwildcard'))->set($this->dbHandler->quoteColumn('destination_url'), $query->bindValue(trim($urlWildcard->destinationUrl, '/ '), null, \PDO::PARAM_STR))->set($this->dbHandler->quoteColumn('id'), $this->dbHandler->getAutoIncrementValue('ezurlwildcard', 'id'))->set($this->dbHandler->quoteColumn('source_url'), $query->bindValue(trim($urlWildcard->sourceUrl, '/ '), null, \PDO::PARAM_STR))->set($this->dbHandler->quoteColumn('type'), $query->bindValue($urlWildcard->forward ? 1 : 2, null, \PDO::PARAM_INT));
     $query->prepare()->execute();
     return $this->dbHandler->lastInsertId($this->dbHandler->getSequenceName('ezurlwildcard', 'id'));
 }
All Usage Examples Of eZ\Publish\Core\Persistence\Database\DatabaseHandler::getAutoIncrementValue