dblayer : define the setters of properties to allow chained ->

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2269 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2015-08-21 12:08:20 +00:00
parent 58f4e000b3
commit e6fca943f6

View File

@@ -51,13 +51,6 @@ class dblayer
public $unique = null;
/** An array to define the foreign keys of the field */
public $foreign = array ();
/** The verify unitary stack
@param string $field The name of the field to test
@param string $val The value of the field to test */
public function verifyOne ($field, $val) {}
/** The verify global stack
@param array $datas The associative array of contents */
public function verifyAll ($datas) {}
/** Debug of the SQL */
public $debug = FALSE;
/** The connecting DSN */
@@ -67,6 +60,14 @@ class dblayer
/** Titles */
public $titles = array ();
/** The verify unitary stack
@param string $field The name of the field to test
@param string $val The value of the field to test */
public function verifyOne ($field, $val) {}
/** The verify global stack
@param array $datas The associative array of contents */
public function verifyAll ($datas) {}
// TODO !!
/** Create Table creation from $this->fields with engine abstraction
Example in sqlite3 id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
@@ -1398,6 +1399,73 @@ class dblayer
{
return $nbLinesDeleted;
}
///////////////////
/// SETTERS ///
///////////////////
/** Set the table property */
public function tableSet ($table)
{
$this->table = $table;
return $this;
}
/** Set the tableprefix property */
public function tableprefixSet ($tableprefix)
{
$this->tableprefix = $tableprefix;
return $this;
}
/** Set the fields property */
public function fieldsSet ($fields)
{
$this->fields = $fields;
return $this;
}
/** Set the primary property */
public function primarySet ($primary)
{
$this->primary = $primary;
return $this;
}
/** Set the unique property */
public function uniqueSet ($unique)
{
$this->unique = $unique;
return $this;
}
/** Set the foreign property */
public function foreignSet ($foreign)
{
$this->foreign = $foreign;
return $this;
}
/** Set the debug property */
public function debugSet ($debug)
{
$this->debug = $debug;
return $this;
}
/** Set the dsn property */
public function dsnSet ($dsn)
{
$this->dsn = $dsn;
return $this;
}
/** Set the titles property */
public function titlesSet ($titles)
{
$this->titles = $titles;
return $this;
}
}
/** POC :