$_db
$_db : \DB
The PEAR::DB object to run queries with.
This class provides attributes methods for any existing SQL class.
Copyright 1999-2017 Horde LLC (http://www.horde.org/)
See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
getByAttributes(array $criteria)
Return a set of ids based on a set of attribute criteria.
array | $criteria | The array of criteria. Example: $criteria['OR'] = array( array('field' => 'name', 'op' => '=', 'test' => 'foo'), array('field' => 'name', 'op' => '=', 'test' => 'bar')); This would return all ids for which the field attribute_name is either 'foo' or 'bar'. |
insertAttributes(integer $id, array $attributes)
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.
integer | $id | The id of the record for which attributes are being inserted. |
array | $attributes | An hash containing the attributes. |
updateAttributes(integer $id, array $attributes)
Given an id, update all attributes for that id in the attributes table with the new attributes.
integer | $id | The id of the record for which attributes are being deleted. |
array | $attributes | An hash containing the attributes. |
_buildAttributeQuery(string $glue, array $criteria, boolean $join = false) : string
Build a piece of an attribute query.
string | $glue | The glue to join the criteria (OR/AND). |
array | $criteria | The array of criteria. |
boolean | $join | Should we join on a clean attributes table? |
An SQL fragment.