yiisoft/yii2 — pull request #6279 by plandem (2014-11-27 13:15:54+00:00)
Title: lastInsertId

lastInsertId at PDO by default check for NULL. At least Postgres. At documentation of PDO - too.