Browse Source

Attempt to throw better orm warnings

Nathaniel van Diepen 6 years ago
parent
commit
b252e7de41
1 changed files with 3 additions and 0 deletions
  1. 3 0
      orm.abstract.class.php

+ 3 - 0
orm.abstract.class.php

@@ -327,6 +327,9 @@
 						trigger_error("First save of {$this->name} may have failed. No affected rows.", E_USER_WARNING);
 					}
 					$this->_data[$pk] = self::$pdo->lastInsertId();
+					if($this->_data[$pk] === 0){
+						trigger_error("First save of {$this->name} may have failed. PK is 0", E_USER_WARNING);
+					}
 				}
 				foreach($this->_related as $related){
 					$related->save();