Procházet zdrojové kódy

Attempt to throw better orm warnings

Nathaniel van Diepen před 6 roky
rodič
revize
b252e7de41
1 změnil soubory, kde provedl 3 přidání a 0 odebrání
  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();