프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$_db | DB | The PEAR::DB object to run queries with. | |
$_params | array | primary_table - The main table name. attribute_table - The table that the attributes are stored in. | |
$_table_count | integer | The number of copies of the attributes table that we need to join on in the current query. |
메소드 | 설명 | |
---|---|---|
Hylax_SQL_Attributes ( DB $dbh, array $params ) | Constructor. | |
_buildAttributeQuery ( string $glue, array $criteria, boolean $join = false ) : string | Build a piece of an attribute query. | |
_getAlias ( boolean $increment = false ) | Get an alias to an attributes table, incrementing it if necessary. | |
deleteAttributes ( integer $id ) | Given an id, delete all attributes for that id from the attributes table. | |
getAttributes ( integer | array $id ) : array | Returns all attributes for a given id or multiple ids. | |
getByAttributes ( array $criteria ) | Return a set of ids based on a set of attribute criteria. | |
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. | |
updateAttributes ( integer $id, array $attributes ) | Given an id, update all attributes for that id in the attributes table with the new attributes. |
public Hylax_SQL_Attributes ( DB $dbh, array $params ) | ||
$dbh | DB | A PEAR::DB object. |
$params | array | The id column, table names, etc. |
public deleteAttributes ( integer $id ) | ||
$id | integer | The id of the record for which attributes are being deleted. |
public getByAttributes ( array $criteria ) | ||
$criteria | array | 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'. |
public insertAttributes ( integer $id, array $attributes ) | ||
$id | integer | The id of the record for which attributes are being inserted. |
$attributes | array | An hash containing the attributes. |
public updateAttributes ( integer $id, array $attributes ) | ||
$id | integer | The id of the record for which attributes are being deleted. |
$attributes | array | An hash containing the attributes. |
public array $_params | ||
리턴 | array |
public int $_table_count | ||
리턴 | integer |