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