DBIx::StORM::Table

StORM StORM Class FilteredRecordSet Inflater LexBindings OrderedRecordSet ParseCV Record RecordArray RecordSet RecordSetWithView SQLDriver SQLDriver:: mysql SQLDriver:: Pg Table TiedCallback TiedColumn TiedRecord TiedTable Index Everything Classes Functions Variables | # DBIx:: StORM:: Table
DBIx::StORM::RecordSet
DBIx::StORM::Table
Summary
DBIx:: StORM:: Table |
DBIx:: StORM:: Table | An StORM class representing a table.
Functions |
_new (private instance) | Create a new DBIx::StORM::Table object from a connection.
_get_sth (private instance) | Actually run the query using the DBI and the SQLDriver and return a result statement handle.
name (public instance) | Get the name of the table this object represents
insert (public instance) | Insert a new row into the table
_filter_id (private instance) | All RecordSets need a unique string identifier which is used for caching.
primary_key (public instance) | Fetch a list of all the primary key column names in this table.
foreign_keys (public instance) | Fetch a hash of all the foreign keys in this table.
grep (public instance) | Filter this DBIx::StORM::RecordSet by applying a result filter.
sort (public instance) | Sort this DBIx::StORM::RecordSet by applying a sort routine.
view (public instance) | Create a new DBIx::StORM::RecordSet with derivable columns added.
grep_pp (public instance) | Filter this DBIx::StORM::RecordSet using a perl filter.
_build_result_identity |
_rebuild_record (private instance) | This is called by a DBIx::StORM::Record when the content has changed or the column set loaded is incorrect.
_get_record_for_fk (private instance) | When a foreign key column in a Record from this table is access, this method is called to generate the Record record for the foreign key.
_table (private instance) | All RecordSets need to be able to quickly fetch the underlying DBIx::StORM::Table object it is derived from.
identity (public instance) | Fetch the record that has a given primary key value.
## DBIx:: StORM:: Table
DBIx::StORM::RecordSet
DBIx::StORM::Table
An StORM class representing a table. This class inherits from DBIx::StORM::RecordSet, so can be grep’d (filtered), sorted and viewed. You can also insert new rows. Tables can be array dereferenced to iterate over the rows in the table. =end NaturalDocs Summary
Functions |
_new (private instance) | Create a new DBIx::StORM::Table object from a connection.
_get_sth (private instance) | Actually run the query using the DBI and the SQLDriver and return a result statement handle.
name (public instance) | Get the name of the table this object represents
insert (public instance) | Insert a new row into the table
_filter_id (private instance) | All RecordSets need a unique string identifier which is used for caching.
primary_key (public instance) | Fetch a list of all the primary key column names in this table.
foreign_keys (public instance) | Fetch a hash of all the foreign keys in this table.
grep (public instance) | Filter this DBIx::StORM::RecordSet by applying a result filter.
sort (public instance) | Sort this DBIx::StORM::RecordSet by applying a sort routine.
view (public instance) | Create a new DBIx::StORM::RecordSet with derivable columns added.
grep_pp (public instance) | Filter this DBIx::StORM::RecordSet using a perl filter.
_build_result_identity |
_rebuild_record (private instance) | This is called by a DBIx::StORM::Record when the content has changed or the column set loaded is incorrect.
_get_record_for_fk (private instance) | When a foreign key column in a Record from this table is access, this method is called to generate the Record record for the foreign key.
_table (private instance) | All RecordSets need to be able to quickly fetch the underlying DBIx::StORM::Table object it is derived from.
identity (public instance) | Fetch the record that has a given primary key value.
### Functions ### _new (private instance) Create a new DBIx::StORM::Table object from a connection. #### Parameters
Object $storm | A connection of type DBIx::StORM
String $table | The table name as a string
#### Returns
Object | A new DBIx::StORM::Table object
=end NaturalDocs ### _get_sth (private instance) Actually run the query using the DBI and the SQLDriver and return a result statement handle. This is a simpler, speedier version of that in DBIx::StORM::RecordSet. #### Parameters None #### Returns
Object | The DBI statement handle of results
Hash | A hash map of column references to result array indices
=end NaturalDocs ### name (public instance) Get the name of the table this object represents #### Parameters None #### Returns
String | The table name as a string
=end NaturalDocs ### insert (public instance) Insert a new row into the table #### Parameters
Subref | A subroutine that initialises the new record, $_ (optional)
#### Returns
Object | A row of type DBIx::StORM::Record
=end NaturalDocs ### _filter_id (private instance) All RecordSets need a unique string identifier which is used for caching. For tables this is the table name. #### Parameters None #### Returns
String | A cachable identifier for this RecordSet configuration
=end NaturalDocs ### primary_key (public instance) Fetch a list of all the primary key column names in this table. #### Parameters None #### Returns
List | String column names of the primary keys
=end NaturalDocs ### foreign_keys (public instance) Fetch a hash of all the foreign keys in this table. The hash key is the string name of the foreign key column in this table, and the value is a table reference to the column in the foreign table. #### Parameters None #### Returns
HashList | Details of the foreign keys used by this table.
=end NaturalDocs ### grep (public instance) Filter this DBIx::StORM::RecordSet by applying a result filter. #### Parameters
SubRef | The filter code as a perl subroutine reference
#### Returns
Object | A new DBIx::StORM::RecordSet which contains just the matching rows
=end NaturalDocs ### sort (public instance) Sort this DBIx::StORM::RecordSet by applying a sort routine. #### Parameters
SubRef | The sort code as a perl subroutine reference, similiar to the one used in perl’s sort operator
#### Returns
Object | A new DBIx::StORM::RecordSet which contains the same rows sorted
=end NaturalDocs ### view (public instance) Create a new DBIx::StORM::RecordSet with derivable columns added. #### Parameters
HashList | The keys in this has the names of the column to create. The value may either be a perl subref which defines how the column is calculated, or a string containing a SQL snippet to generate the column
#### Returns
Object | A new DBIx::StORM::RecordSet which contains the same rows with the new columns added
=end NaturalDocs ### grep_pp (public instance) Filter this DBIx::StORM::RecordSet using a perl filter. This is identical to the <grep> method, but does not attempt to parse the subref and optimise it. #### Parameters
SubRef | The filter code as a perl subroutine reference
#### Returns
Object | A new DBIx::StORM::RecordSet which contains just the matching rows
> =end NaturalDocs ### _build_result_identity
> sub _build_result_identity
### _rebuild_record (private instance) This is called by a DBIx::StORM::Record when the content has changed or the column set loaded is incorrect. It causes the object to be rebuilt with a new set of column. The object is modified in-situ. The row is selected from the database by primary key column equality, so it won’t work on tables without a PK. #### Parameters
Object $record | DBIx::StORM::Record to rebuild
Boolean $full | Whether to fetch all rows, or just the ones requested by the record object
#### Returns None =end NaturalDocs ### _get_record_for_fk (private instance) When a foreign key column in a Record from this table is access, this method is called to generate the Record record for the foreign key. #### Parameters
String $column | the name of the foreign key column
String $value | the value of the column in the calling record
Object $resultset | the resultset that the calling record came from
String $base_ref | the path to the table the calling record comes from
HashRef $table_mapping | the calling record’s mapping of column references to content indexes
ArrayRef $content | The column values contained in the calling record
#### Returns
Object | A DBIx::StORM::Record
=end NaturalDocs ### _table (private instance) All RecordSets need to be able to quickly fetch the underlying DBIx::StORM::Table object it is derived from. In the case of DBIx::StORM::Table this is the object itself. #### Parameters None #### Returns
Object | Object of type DBIx::StORM::Table
=end NaturalDocs ### identity (public instance) Fetch the record that has a given primary key value. For one-column primary keys you can pass in the value directly. Otherwise a hash reference should be passed in of field name => field value mappings. If you incorrectly specify the primary key this function will die. #### Parameters
$primary_key_info | Either a value or hashref specifying the primary key value(s) of the desired Record.
#### Returns
Object | Object of type DBIx::StORM::Record
=end NaturalDocs

> sub _build_result_identity