diff --git a/dblayer.php b/dblayer.php index c6fde44..88f39b8 100644 --- a/dblayer.php +++ b/dblayer.php @@ -34,22 +34,22 @@ require_once ("domframework/verify.php"); class dblayer extends PDO { /** The fields with the definition of type, and special parameters */ - protected $fields = array (); + public $fields = array (); /** The primary field */ - protected $primary = null; + public $primary = null; /** An array to define the unique fields (or array of unique fields) */ - protected $unique = null; + public $unique = null; /** An array to define the foreign keys of the field */ - protected $foreign = array (); + public $foreign = array (); /** The db connection */ - protected $db = null; + public $db = null; /** The verify unitary stack @param string $field The name of the field to test @param string $val The value of the field to test */ - protected function verifyOne ($field, $val) {} + public function verifyOne ($field, $val) {} /** The verify global stack @param array $datas The associative array of contents */ - protected function verifyAll ($datas) {} + public function verifyAll ($datas) {} /** Debug of the SQL */ public $debug = FALSE; /** Return all the tables available in the database */ @@ -527,6 +527,9 @@ class dblayer extends PDO // Unique fields if ($this->unique !== null) { + if (!is_array ($this->unique)) + throw new Exception ( + _("The Unique field definition is not an array")); foreach ($this->unique as $u) { $sql .= ",\n UNIQUE (`";