dblayers functions are now public
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1468 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
17
dblayer.php
17
dblayer.php
@@ -34,22 +34,22 @@ require_once ("domframework/verify.php");
|
|||||||
class dblayer extends PDO
|
class dblayer extends PDO
|
||||||
{
|
{
|
||||||
/** The fields with the definition of type, and special parameters */
|
/** The fields with the definition of type, and special parameters */
|
||||||
protected $fields = array ();
|
public $fields = array ();
|
||||||
/** The primary field */
|
/** The primary field */
|
||||||
protected $primary = null;
|
public $primary = null;
|
||||||
/** An array to define the unique fields (or array of unique fields) */
|
/** 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 */
|
/** An array to define the foreign keys of the field */
|
||||||
protected $foreign = array ();
|
public $foreign = array ();
|
||||||
/** The db connection */
|
/** The db connection */
|
||||||
protected $db = null;
|
public $db = null;
|
||||||
/** The verify unitary stack
|
/** The verify unitary stack
|
||||||
@param string $field The name of the field to test
|
@param string $field The name of the field to test
|
||||||
@param string $val The value 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
|
/** The verify global stack
|
||||||
@param array $datas The associative array of contents */
|
@param array $datas The associative array of contents */
|
||||||
protected function verifyAll ($datas) {}
|
public function verifyAll ($datas) {}
|
||||||
/** Debug of the SQL */
|
/** Debug of the SQL */
|
||||||
public $debug = FALSE;
|
public $debug = FALSE;
|
||||||
/** Return all the tables available in the database */
|
/** Return all the tables available in the database */
|
||||||
@@ -527,6 +527,9 @@ class dblayer extends PDO
|
|||||||
// Unique fields
|
// Unique fields
|
||||||
if ($this->unique !== null)
|
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)
|
foreach ($this->unique as $u)
|
||||||
{
|
{
|
||||||
$sql .= ",\n UNIQUE (`";
|
$sql .= ",\n UNIQUE (`";
|
||||||
|
|||||||
Reference in New Issue
Block a user