SimplOn PHP
 All Data Structures Namespaces Files Functions Variables
Public Member Functions | Data Fields | Static Public Attributes
SQL Class Reference
+ Inheritance diagram for SQL:

Public Member Functions

 __construct ($server, $dataBase, $user, $password)
 createDB ($db_name)
 getElementsData (&$element, $filters=null, $range= '0, 500')
 readElement (&$element)
 processRange ($range)
 processConditions ($conditions)
 isSetElementStorage (\SimplOn\Elements\Element &$element)
 alterTable (\SimplOn\Elements\Element $element)
 isValidElementStorage (\SimplOn\Elements\Element &$element)
 createTable ($element)
 ensureElementStorage (\SimplOn\Elements\Element &$element)
 getDataTypes (\SimplOn\Elements\Element &$element)
 delete (\SimplOn\Elements\Element &$element)
 deleteElement (\SimplOn\Elements\Element &$element)
 createElement (\SimplOn\Elements\Element &$element)
 updateElement (\SimplOn\Elements\Element &$element)
 readElements (\SimplOn\Elements\Element &$element, $returnAs= 'array')
 filterCriteria ($element_or_criteria)
 obtainValues (\SimplOn\Elements\Element &$element, $query_string)

Data Fields

 $db

Static Public Attributes

static $typesMap
static $operandsMap

Detailed Description

Definition at line 22 of file SQL.php.


Constructor & Destructor Documentation

__construct ( server,
dataBase,
user,
password 
) [abstract]

Reimplemented in SQLite, and MySql.


Member Function Documentation

Definition at line 112 of file SQL.php.

createDB ( db_name) [abstract]

Reimplemented in MySql, and SQLite.

Definition at line 333 of file SQL.php.

createTable ( element)

At this point the table is created with the minimum columns (primary keys) and the rest of the columns are added later with alterTable method

Definition at line 246 of file SQL.php.

delete ( \SimplOn\Elements\Element &$  element)

Definition at line 319 of file SQL.php.

Definition at line 324 of file SQL.php.

Definition at line 271 of file SQL.php.

filterCriteria ( element_or_criteria)

Definition at line 476 of file SQL.php.

Definition at line 295 of file SQL.php.

getElementsData ( &$  element,
filters = null,
range = '0,
500'   
)

Definition at line 51 of file SQL.php.

Definition at line 108 of file SQL.php.

Definition at line 165 of file SQL.php.

obtainValues ( \SimplOn\Elements\Element &$  element,
query_string 
)

Definition at line 508 of file SQL.php.

processConditions ( conditions)

Definition at line 103 of file SQL.php.

processRange ( range)

Definition at line 98 of file SQL.php.

readElement ( &$  element)

Definition at line 68 of file SQL.php.

readElements ( \SimplOn\Elements\Element &$  element,
returnAs = 'array' 
)

Example: $array_of_datas = array( array( 'SimplOn_class' => 'Home', 'SimplOn_field_id' => 'id', 'SimplOn_id' => 1, 'id' => 1, ... ), ... );

Definition at line 394 of file SQL.php.

Definition at line 374 of file SQL.php.


Field Documentation

$db

Reimplemented from DataStorage.

Definition at line 25 of file SQL.php.

$operandsMap [static]
Initial value:
 array(
        '==' => '=',
    )

Definition at line 42 of file SQL.php.

$typesMap [static]
Initial value:
 array(
        'NumericId'     => 'int(11) auto_increment',
        'StringId'      => 'varchar(240)',
        
        'Integer'       => 'int(11)',
        'Float'         => 'float',
        
        'Date'          => 'date',
        
        'String'        => 'varchar(240)',
                
        'Text'      => 'text',
        'ElementContainer' => '_ForeignKey_',
    )

Reimplemented in SQLite.

Definition at line 27 of file SQL.php.


The documentation for this class was generated from the following file: