yii\db\Connection::getLastInsertID PHP Метод

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

Returns the ID of the last inserted row or sequence value.
См. также: http://www.php.net/manual/en/function.PDO-lastInsertId.php
public getLastInsertID ( string $sequenceName = '' ) : string
$sequenceName string name of the sequence object (required by some DBMS)
Результат string the row ID of the last row inserted, or the last value retrieved from the sequence object
    public function getLastInsertID($sequenceName = '')
    {
        return $this->getSchema()->getLastInsertID($sequenceName);
    }

Usage Example

Пример #1
0
 /**
  * Returns id of inserted record
  *
  * @return int
  */
 protected function lastInsertId()
 {
     return (int) $this->db->getLastInsertID();
 }
All Usage Examples Of yii\db\Connection::getLastInsertID