|
| | isI18n () |
| |
| | hasI18n () |
| |
| | getI18nTable () |
| |
| | getI18nFields () |
| |
| | getDb () |
| |
| | getWhere (array $prm=array()) |
| |
| | isLinked ($field) |
| |
| | getLinkedTableName ($tablename) |
| |
| | getLinked ($field=null) |
| |
| | getLinkedTable ($field) |
| |
| | getLinkedTableRow ($field, array $data=array()) |
| |
| | isRelated ($name) |
| |
| | getRelated ($name=null) |
| |
| | getRelatedTableRow ($name, array $data=array()) |
| |
| | getRelatedTable ($name) |
| |
| | getRelatedTableName ($name, $add=true) |
| |
| | getTargetingTables () |
| |
| | isTargeting ($tableName) |
| |
| | getLabel ($field=null) |
| |
| | getI18nLabel ($field=null) |
| |
| | getField ($field=null, $keyVal=null) |
| |
| | getFieldFile () |
| |
| | getCols () |
| |
| | getName () |
| |
| | getRawName () |
| |
| | getIdent () |
| |
| | getPrimary () |
| |
| | insert (array $data) |
| |
| | replace (array $data) |
| |
| | update (array $data, $where=null) |
| |
| | delete ($where=null) |
| |
| | dateAutoData (array &$data, $type) |
| |
| | select (array $prm=array()) |
| |
| | count (array $prm) |
| |
| | selectQuery (array $prm, &$tmpTables) |
| |
| | find ($where) |
| |
| | findText ($text, $filter=null) |
| |
| | getRange ($field=null) |
| |
| | clearCache ($clearTargeting=null) |
| |
| | getRow (array $data=array(), $withAuto=false, array $morePrm=array()) |
| |
| | getAttr ($name) |
| |
| | setAttr ($name, $value) |
| |
| | getCfg () |
| |
SQL Table interface
Definition at line 10 of file table.class.php.
◆ _initFields()
◆ _initI18n()
◆ _initIdent()
Initialize the primary and ident information, if needed
Definition at line 164 of file table.class.php.
◆ _initLabels()
◆ _initLinkedTables()
◆ _initRelatedTables()
◆ afterInit()
◆ beforeInit()
Call just before the configuration initialisation
Definition at line 35 of file object.class.php.
◆ clearCache()
| clearCache |
( |
|
$clearTargeting = null | ) |
|
Clear the cache of selected queries for this table
- Parameters
-
| bool | null | $clearTargeting | Indifcate if cache of targeting tables should also be cleared. If null, default settings will be used |
- Returns
- int|bool Number of cache deleted or false
Definition at line 1266 of file table.class.php.
◆ count()
Count the number of result
- Parameters
-
| array | $prm | The initial parameter |
- Returns
- int
Definition at line 840 of file table.class.php.
◆ dateAutoData()
| dateAutoData |
( |
array & |
$data, |
|
|
|
$type |
|
) |
| |
Add an automatic field date
- Parameters
-
| array | $data | Record values; will be modified if needed |
| string | $type | Type to insert date |
- Returns
- bool True if the date was added
Definition at line 761 of file table.class.php.
◆ dateValue()
Get a date value regarding a SQL type. If not parsed, time() will be affected
- Parameters
-
| string | $type | SQL type (date and datetime parsed) |
- Returns
- mixed The date value
Definition at line 777 of file table.class.php.
◆ delete()
Delete data in the table
- Parameters
-
| db_where | array | string | $where | : The where clause. If array, they are used with AND. (default: none) |
- Returns
- int Deleted rows
- See also
- db_abstract::delete
Definition at line 702 of file table.class.php.
◆ find()
◆ findText()
| findText |
( |
|
$text, |
|
|
|
$filter = null |
|
) |
| |
Search text in every text fileds present the table
- Parameters
-
| string | $text | The text to search |
| db_where | array | string | $where | Same paramter than select |
- Returns
- db_rowset
- See also
- select
Definition at line 1216 of file table.class.php.
◆ getAttr()
Get an attribute
- Parameters
-
| string | $name | Attribute name |
- Returns
- mixed|null The attribute or null if not set
Definition at line 48 of file object.class.php.
◆ getCfg()
Get the configuration object
- Returns
- config
Definition at line 67 of file object.class.php.
◆ getCols()
◆ getDb()
◆ getField()
| getField |
( |
|
$field = null, |
|
|
|
$keyVal = null |
|
) |
| |
Get the fields information
- Parameters
-
| string | null | $field | Field name. If null, the whole field array will be returned |
| string | null | $keyVal | Value to retrieve directly |
- Returns
- array|null
Definition at line 566 of file table.class.php.
◆ getFieldFile()
Get the fields which are file
- Returns
- array|null;
Definition at line 581 of file table.class.php.
◆ getI18nFields()
◆ getI18nLabel()
| getI18nLabel |
( |
|
$field = null | ) |
|
Get the label for the i18n fields
- Parameters
-
| null | string | $field | Fieldname or null to retrieve an all of them as an array |
- Returns
- array|string
Definition at line 555 of file table.class.php.
◆ getI18nTable()
◆ getIdent()
◆ getLabel()
| getLabel |
( |
|
$field = null | ) |
|
Get the label for the fields
- Parameters
-
| null | string | $field | Fieldname or null to retrieve an all of them as an array |
- Returns
- array|string
Definition at line 538 of file table.class.php.
◆ getLinked()
| getLinked |
( |
|
$field = null | ) |
|
Get the linked information about a field
- Parameters
-
| string | null | $field | Field name. If null the whole table will be returned |
- Returns
- array|null
Definition at line 290 of file table.class.php.
◆ getLinkedTable()
Get the table object for a link field
- Parameters
-
- Returns
- db_table|null
Definition at line 305 of file table.class.php.
◆ getLinkedTableName()
| getLinkedTableName |
( |
|
$tablename | ) |
|
Get linked info with a table name
- Parameters
-
| string | $tablename | table name |
- Returns
- array|null Smae result than
Definition at line 275 of file table.class.php.
◆ getLinkedTableRow()
| getLinkedTableRow |
( |
|
$field, |
|
|
array |
$data = array() |
|
) |
| |
Get a row for a linked table
- Parameters
-
| string | $field | Field Name |
| array | $data | The data for overwrite the default value |
- Returns
- db_row
Definition at line 323 of file table.class.php.
◆ getName()
◆ getPrimary()
◆ getRange()
| getRange |
( |
|
$field = null | ) |
|
Get the min and the max value for a field.
- Parameters
-
| string | $field | Fieldname. If null, id is used |
- Returns
- array With key min and max
Definition at line 1246 of file table.class.php.
◆ getRawName()
◆ getRelated()
| getRelated |
( |
|
$name = null | ) |
|
Get the related table
- Parameters
-
| string | $name | If need only 1 related information |
- Returns
- array|null
Definition at line 384 of file table.class.php.
◆ getRelatedTable()
Get the related table object
- Parameters
-
| string | $name | Related table name |
- Returns
- db_table
Definition at line 411 of file table.class.php.
◆ getRelatedTableName()
| getRelatedTableName |
( |
|
$name, |
|
|
|
$add = true |
|
) |
| |
Get the name of the related table
- Parameters
-
| string | $name | |
| bool | $add | if True, the prefix will be added if needed. If false, it will removed if needed |
- Returns
- string
Definition at line 424 of file table.class.php.
◆ getRelatedTableRow()
| getRelatedTableRow |
( |
|
$name, |
|
|
array |
$data = array() |
|
) |
| |
Get a row for a related table
- Parameters
-
| string | $name | Table Name |
| array | $data | The data for overwrite the default value |
- Returns
- db_row
Definition at line 399 of file table.class.php.
◆ getRow()
| getRow |
( |
array |
$data = array(), |
|
|
|
$withAuto = false, |
|
|
array |
$morePrm = array() |
|
) |
| |
Get a row
- Parameters
-
| array | $data | The data for overwrite the default value |
| bool | $withAuto | Include auto field |
| array | $morePrm | Array of configuration for the row |
- Returns
- db_row
Definition at line 1291 of file table.class.php.
◆ getTargetingTables()
Get Targeting table names
- Returns
- array Targeting table names
Definition at line 440 of file table.class.php.
◆ getWhere()
| getWhere |
( |
array |
$prm = array() | ) |
|
Get a where object
- Parameters
-
| array | $prm | The configuration for the where object |
- Returns
- db_where
Definition at line 255 of file table.class.php.
◆ hasI18n()
Indicate if the thable has a i18n table
- Returns
- bool
Definition at line 107 of file table.class.php.
◆ insert()
Insert into the table
- Parameters
-
| array | $data | The values to insert. The key are the identifier |
- Returns
- mixed the inserted id
- See also
- db_abstract::insert
Definition at line 642 of file table.class.php.
◆ isI18n()
Indicate if the table is a i18n table
- Returns
- bool
Definition at line 98 of file table.class.php.
◆ isLinked()
Check if a field name is linked to a table
- Parameters
-
- Returns
- bool
Definition at line 265 of file table.class.php.
◆ isRelated()
Check if a table name is ralted to the table
- Parameters
-
- Returns
- bool
Definition at line 374 of file table.class.php.
◆ isTargeting()
| isTargeting |
( |
|
$tableName | ) |
|
Indicates if the table is targeting an other table
- Parameters
-
| strong | $tableName | Table name to check against |
- Returns
- boolean
Definition at line 471 of file table.class.php.
◆ parseLinked()
| static parseLinked |
( |
array & |
$data, |
|
|
array |
$linked |
|
) |
| |
|
static |
Parse select result for the linked and related tables
- Parameters
-
| array | $data | (reference, will be updated) Data issued from the select |
| array | $linked | Linked array issued from the select |
Definition at line 1091 of file table.class.php.
◆ replace()
Replace into the table
- Parameters
-
| array | $data | The values to insert. The key are the identifier |
- Returns
- mixed the inserted id
- See also
- db_abstract::insert
Definition at line 662 of file table.class.php.
◆ select()
| select |
( |
array |
$prm = array() | ) |
|
Search on the table
- Parameters
-
| array | $prm | Select query configuration. Same parameter than db::select, with more:
- db_where|string|null filter: Where clause to filter the result. If string, serach to be equal to the identity
- bool first: Return onlt the first result as a db_row
|
- Returns
- db_rowset|db_row
- See also
- selectQuery, db_abstract::select
Definition at line 799 of file table.class.php.
◆ selectQuery()
| selectQuery |
( |
array |
$prm, |
|
|
& |
$tmpTables |
|
) |
| |
Create the right array paremeter for select query
- Parameters
-
| array | $prm | The initial parameter |
| array | $tmpTables | Array used with parseLinked |
Definition at line 867 of file table.class.php.
◆ setAttr()
| setAttr |
( |
|
$name, |
|
|
|
$value |
|
) |
| |
|
inherited |
Set an attribute
- Parameters
-
| string | $name | Attribute name |
| mixed | $value | Attribute value |
Definition at line 58 of file object.class.php.
◆ update()
| update |
( |
array |
$data, |
|
|
|
$where = null |
|
) |
| |
update data in the table
- Parameters
-
| array | $data | The values to update. The key are the identifier |
| db_where | array | string | $where | : The where clause. If array, they are used with AND. (default: none) |
- Returns
- int Affected rows
- See also
- db_abstract::update
Definition at line 683 of file table.class.php.
◆ $cfg
◆ $cols
◆ $fields
◆ $i18nTable
◆ $linkedTableNames
◆ $linkedTables
◆ $rawName
◆ $relatedTables
◆ $targetingTables
The documentation for this class was generated from the following file: