|
| | loadData (array $data) |
| |
| | reload ($force=true) |
| |
| | getDb () |
| |
| | getTable () |
| |
| | getWhere (array $prm=array()) |
| |
| | getForm ($showFields=null, array $formParam=array(), $passConfirm=true) |
| |
| | isNew () |
| |
| | setNew ($new) |
| |
| | insert () |
| |
| | save () |
| |
| | saveRelated () |
| |
| | saveI18n () |
| |
| | delete () |
| |
| | getId () |
| |
| | clear () |
| |
| | keyExists ($key) |
| |
| | get ($key, $mode='flat') |
| |
| | getI18n ($key, $mode='flat', $lang=null) |
| |
| | getI18nRow ($lang=null) |
| |
| | getI18nRows () |
| |
| | getValues ($mode='data') |
| |
| | getInValues ($name=null, $mode='flatReal') |
| |
| | set ($key, $value, $force=false) |
| |
| | setI18n (array $values, $force=false, $lg=null) |
| |
| | setValues (array $values, $force=false) |
| |
| | getChanges ($name=null) |
| |
| | getChangesTable () |
| |
| | getChangesOther () |
| |
| | getChangesI18n () |
| |
| | hasChange ($name=null) |
| |
| | getLinked ($field=null, $reload=false) |
| |
| | setLinked ($linked, $field=null) |
| |
| | getRelated ($name) |
| |
| | setRelated ($related, $name=null) |
| |
| | whereClause () |
| |
| | getAround (array $prm=array()) |
| |
| | __call ($name, $prm) |
| |
| | offsetExists ($offset) |
| |
| | offsetGet ($offset) |
| |
| | offsetSet ($offset, $value) |
| |
| | offsetUnset ($offset) |
| |
| | __get ($name) |
| |
| | __set ($name, $val) |
| |
| | __toString () |
| |
| | getAttr ($name) |
| |
| | setAttr ($name, $value) |
| |
| | getCfg () |
| |
Interface for db classes
Definition at line 10 of file row.class.php.
◆ __call()
◆ __get()
◆ __set()
◆ __toString()
◆ afterInit()
◆ beforeInit()
Call just before the configuration initialisation
Definition at line 35 of file object.class.php.
◆ clear()
◆ delete()
Delete the current row
- Returns
- bool True if successful
Definition at line 357 of file row.class.php.
◆ get()
| get |
( |
|
$key, |
|
|
|
$mode = 'flat' |
|
) |
| |
Get a value
- Parameters
-
| string | $key | Fieldname |
| string | $mode | Mode to retrieve the value, only used for related (flat or flatReal) |
- Returns
- mixed The value
Definition at line 399 of file row.class.php.
◆ getAround()
| getAround |
( |
array |
$prm = array() | ) |
|
Get the value of a field around the row
- Parameters
-
| array | $prm | Parameter with key:
- string field: Fieldname on which the comparison should be done
- string returnId: True to return id instead of field
- string where: Where clause to filter results
- boolean asRow: Indicates if the result should be retrieved as db_row object or simple value. Should be set to true only when using ident
|
- Returns
- array With 2 indexes; 0 -> field value of the previous row (or null), 1 for the next one
Definition at line 850 of file row.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.
◆ getChanges()
| getChanges |
( |
|
$name = null | ) |
|
Get the changes for the table or only one field
- Parameters
-
| null | string | $name | Field Name or null |
- Returns
- array|mixed|null
Definition at line 658 of file row.class.php.
◆ getChangesI18n()
◆ getChangesOther()
Get the changes for the related table
- Returns
- array
Definition at line 681 of file row.class.php.
◆ getChangesTable()
Get the changes in the table only
- Returns
- array
Definition at line 672 of file row.class.php.
◆ getDb()
◆ getForm()
| getForm |
( |
|
$showFields = null, |
|
|
array |
$formParam = array(), |
|
|
|
$passConfirm = true |
|
) |
| |
Get the default form with the field information
- Parameters
-
| null | array | $showFields | null to get every fields or array to select the fields |
| array | $formParam | Parameter for the form |
| bool | $passConfirm | Indicate if the confirmation password should ba automatically added |
- Returns
- form_db
Definition at line 152 of file row.class.php.
◆ getI18n()
| getI18n |
( |
|
$key, |
|
|
|
$mode = 'flat', |
|
|
|
$lang = null |
|
) |
| |
Get a i18n value
- Parameters
-
| string | $key | Fieldname |
| string | $mode | Mode to retrieve the value, only used for related (flat or flatReal) |
- Returns
- mixed The value
Definition at line 466 of file row.class.php.
◆ getI18nRow()
| getI18nRow |
( |
|
$lang = null | ) |
|
Get a i18nRow
- Parameters
-
| string | $lang | Lang needed (if null, the current will be used or a new row will be created) |
- Returns
- db_row
Definition at line 476 of file row.class.php.
◆ getI18nRows()
Get the instancied i18n rows
- Returns
- array
Definition at line 497 of file row.class.php.
◆ getId()
Return the current id
- Returns
- mixed
Definition at line 372 of file row.class.php.
◆ getInValues()
| getInValues |
( |
|
$name = null, |
|
|
|
$mode = 'flatReal' |
|
) |
| |
Get only one value, using the getValues function
- Parameters
-
| string | $name | Fieldname |
| string | $mode | Mode used to retrieve data |
- Returns
- mixed|null The value found or null
- See also
- getValues
Definition at line 588 of file row.class.php.
◆ getLinked()
| getLinked |
( |
|
$field = null, |
|
|
|
$reload = false |
|
) |
| |
Get a linked row
- Parameters
-
| string | $field | Field Name |
| bool | $reload | indicate if the row should be reloaded |
- Returns
- db_row|null
Definition at line 722 of file row.class.php.
◆ getRelated()
◆ getTable()
◆ getValues()
| getValues |
( |
|
$mode = 'data' | ) |
|
Get the values in an array
- Parameters
-
| string | $mode | Return mode (data, flat, flatNoRelated, flatReal, flatRealNoRelated) |
- Returns
- array
Definition at line 507 of file row.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 140 of file row.class.php.
◆ hasChange()
| hasChange |
( |
|
$name = null | ) |
|
Check if the table has a change or only one field
- Parameters
-
| null | string | $name | Field Name or null |
- Returns
- bool
Definition at line 703 of file row.class.php.
◆ insert()
Create a new row with the current values
- Returns
- mixed The last inserted id
Definition at line 263 of file row.class.php.
◆ isNew()
Check if the row is new
- Returns
- bool
Definition at line 245 of file row.class.php.
◆ keyExists()
Check if a key exists in the current row
- Returns
- bool
Definition at line 388 of file row.class.php.
◆ loadData()
Load data in the row
- Parameters
-
Definition at line 78 of file row.class.php.
◆ offsetExists()
Check if an index exists. Required by interface ArrayAccess
- Parameters
-
- Returns
- bool
Definition at line 947 of file row.class.php.
◆ offsetGet()
Get a value. Required by interface ArrayAccess
- Parameters
-
- Returns
- mixed
Definition at line 958 of file row.class.php.
◆ offsetSet()
| offsetSet |
( |
|
$offset, |
|
|
|
$value |
|
) |
| |
Set a value. Required by interface ArrayAccess
- Parameters
-
Definition at line 969 of file row.class.php.
◆ offsetUnset()
Remove an element. Required by interface ArrayAccess
- Parameters
-
Definition at line 979 of file row.class.php.
◆ reload()
Reload the row data against the db
- Parameters
-
| bool | $force | Force reload or do it only if needed |
Definition at line 109 of file row.class.php.
◆ save()
Save the row in the database
- Returns
- bool|mixed True if successful or no changes was done|mixed if new and inserted, will be last insert id
Definition at line 280 of file row.class.php.
◆ saveI18n()
◆ saveRelated()
Save the related values if need
- Exceptions
-
Definition at line 302 of file row.class.php.
◆ set()
| set |
( |
|
$key, |
|
|
|
$value, |
|
|
|
$force = false |
|
) |
| |
Set a value
- Parameters
-
| string | $key | Fieldname |
| mixed | $value | Value |
| bool | $force | Indicates if the value should be replaced even if it's the same |
- Exceptions
-
Definition at line 603 of file row.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.
◆ setI18n()
| setI18n |
( |
array |
$values, |
|
|
|
$force = false, |
|
|
|
$lg = null |
|
) |
| |
Set i18n values
- Parameters
-
| array | $values | Values |
| bool | $force | Indicates if the value should be replaced even if it's the same |
| string | null | $lg | Lang |
Definition at line 631 of file row.class.php.
◆ setLinked()
| setLinked |
( |
|
$linked, |
|
|
|
$field = null |
|
) |
| |
Set new linked values
- Parameters
-
| array | db_row | $linked | array of db_row or values of array OR db_row or array of values should be provide $field |
| string | null | $field | Field Name (null if array set) |
Definition at line 748 of file row.class.php.
◆ setNew()
◆ setRelated()
| setRelated |
( |
|
$related, |
|
|
|
$name = null |
|
) |
| |
Set new linked values
- Parameters
-
| array | db_row | $related | array of db_row or values of array OR db_row or array of values should be provide $name |
| string | null | $name | Table Name (null if array set) |
Definition at line 793 of file row.class.php.
◆ setValues()
| setValues |
( |
array |
$values, |
|
|
|
$force = false |
|
) |
| |
Set a values array
- Parameters
-
| array | $values | |
| bool | $force | Indicates if the value should be replaced even if it's the same |
Definition at line 647 of file row.class.php.
◆ whereClause()
Construct Where clause regarding the id
- Returns
- string
Definition at line 830 of file row.class.php.
◆ $cfg
◆ $changes
◆ $i18nRows
◆ $linked
◆ $new
◆ $related
◆ $table
The documentation for this class was generated from the following file: