[ Index ] |
|
Code source de Horde 3.1.3 |
[Code source] [Imprimer] [Statistiques]
(pas de description)
Poids: | 347 lignes (13 kb) |
Inclus ou requis: | 0 fois |
Référencé: | 0 fois |
Nécessite: | 0 fichiers |
Horde_SQL_Attributes:: (9 méthodes):
Horde_SQL_Attributes()
getAttributes()
getByAttributes()
insertAttributes()
deleteAttributes()
updateAttributes()
_buildAttributeQuery()
_getAlias()
singleton()
Classe: Horde_SQL_Attributes - X-Ref
This class provides attributes methods for any existing SQL class.Horde_SQL_Attributes($dbh, $params) X-Ref |
Constructor. param: DB $dbh A PEAR::DB object. param: array $params The id column, table names, etc. |
getAttributes($id) X-Ref |
Returns all attributes for a given id or multiple ids. param: integer | array $id The id to fetch or an array of ids. return: array A hash of attributes, or a multi-level hash |
getByAttributes($criteria) X-Ref |
Return a set of ids based on a set of attribute criteria. param: array $criteria The array of criteria. Example: |
insertAttributes($id, $attributes) X-Ref |
Given a new attribute set and an id, insert each into the DB. If anything fails in here, rollback the transaction, return the relevant error and bail out. param: integer $id The id of the record for which attributes are param: array $attributes An hash containing the attributes. |
deleteAttributes($id) X-Ref |
Given an id, delete all attributes for that id from the attributes table. param: integer $id The id of the record for which attributes are being |
updateAttributes($id, $attributes) X-Ref |
Given an id, update all attributes for that id in the attributes table with the new attributes. param: integer $id The id of the record for which attributes are param: array $attributes An hash containing the attributes. |
_buildAttributeQuery($glue, $criteria, $join = false) X-Ref |
Build a piece of an attribute query. param: string $glue The glue to join the criteria (OR/AND). param: array $criteria The array of criteria. param: boolean $join Should we join on a clean attributes table? return: string An SQL fragment. |
_getAlias($increment = false) X-Ref |
Get an alias to an attributes table, incrementing it if necessary. param: boolean $increment Increment the alias count? Defaults to false. |
singleton($dbh, $params) X-Ref |
Attempts to return a reference to a concrete SQL Attributes instance based on parameters passed. It will only create a new instance if no Attributes instance with the same parameters currently exists. This should be used if multiple SQL attribute tables are required. This method must be invoked as: $var = &Horde_SQL_Attributes::singleton() param: DB $dbh An object pointing to a SQL database handle. param: array $params Parameters for the attributes table, consisting |
Généré le : Sun Feb 25 18:01:28 2007 | par Balluche grâce à PHPXref 0.7 |