Prado\Data\Common\Mssql\TMssqlCommandBuilder::getLastInsertID PHP 메소드

getLastInsertID() 공개 메소드

Overrides parent implementation. Uses "SELECT @@Identity".
public getLastInsertID ( ) : integer
리턴 integer last insert id, null if none is found.
    public function getLastInsertID()
    {
        foreach ($this->getTableInfo()->getColumns() as $column) {
            if ($column->hasSequence()) {
                $command = $this->getDbConnection()->createCommand('SELECT @@Identity');
                return intval($command->queryScalar());
            }
        }
    }