-------------- Omeka_Db_Table -------------- .. php:class:: Omeka_Db_Table Package: :doc:`Db\\Table ` Database table classes. Subclasses attached to models must follow the naming convention:Table_TableName, e.g. Table_ElementSet in models/Table/ElementSet.php. .. php:attr:: _target The name of the model for which this table will retrieve objects. .. php:attr:: _name The name of the table (sans prefix). If this is not given, it will be inflected. .. php:attr:: _tablePrefix The table prefix. Generally used to differentiate Omeka installations sharing a database. .. php:attr:: _db The Omeka database object. .. php:method:: __construct(string $targetModel, Omeka_Db $db) Construct the database table object. Do not instantiate this by itself. Access instances only viaOmeka_Db::getTable(). :param string $targetModel: Class name of the table's model. :param Omeka_Db $db: Database object to use for queries. .. php:method:: __call(string $m, array $a) Delegate to the database adapter. Used primarily as a convenience method. For example, you can callfetchOne() and fetchAll() directly from this object. :param string $m: Method name. :param array $a: Method arguments. :returns: mixed .. php:method:: getTableAlias() Retrieve the alias for this table (the name without the prefix). :returns: string .. php:method:: getDb() Retrieve the Omeka_Db instance. :returns: Omeka_Db .. php:method:: hasColumn(string $field) Determine whether a model has a given column. :param string $field: Field name. :returns: bool .. php:method:: getColumns() Retrieve a list of all the columns for a given model. This should be here and not in the model class because get_class_vars()returns private/protected properties when called from within the class.Will only return public properties when called in this fashion. :returns: array .. php:method:: getTableName() Retrieve the name of the table for the current table (used in SQL statements). If the table name has not been set, it will inflect the table name. :returns: string .. php:method:: setTableName(string $name) Set the name of the database table accessed by this class. If no name is provided, it will inflect the table name from the name ofthe model defined in the constructor. For example, Item -> items. :param string $name: (optional) Table name. :returns: void .. php:method:: getTablePrefix() Retrieve the table prefix for this table instance. :returns: string .. php:method:: setTablePrefix(string|null $tablePrefix) Set the table prefix. Defaults to the table prefix defined by the Omeka_Db instance. Thisshould remain the default in most cases. However, edge cases may requirecustomization, e.g. creating wrappers for tables generated by otherapplications. :param string|null $tablePrefix: .. php:method:: find(integer $id) Retrieve a single record given an ID. :param integer $id: :returns: Omeka_Record_AbstractRecord|false .. php:method:: findAll() Get a set of objects corresponding to all the rows in the table WARNING: This will be memory intensive and is thus not recommended forlarge data sets. :returns: array Array of {@link Omeka_Record_AbstractRecord}s. .. php:method:: findPairsForSelectForm(array $options = Array) Retrieve an array of key=>value pairs that can be used as options in a