DBIx::StORM::Record

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:: Record
DBIx::StORM::Record
DBIx::StORM::Class
Summary
DBIx:: StORM:: Record |
DBIx:: StORM:: Record | A StORM class representing an individual row from the database.
Functions |
_new (private instance) | Create a new DBIx::StORM::Record object from the RecordSet.
_as_tied_hash (private instance) | Used by overloading to provide hash-reference access.
get (public instance) | Fetch a field from the Record.
_get_simple_value (private instance) | Fetch the scalar value of a “simple” (ie.
_build_column_information_for_get (private instance) | Turn a string column name into a fully qualified content path, and also check to see if it’s a foreign key lookup and fetch the result if so.
_as_string (private instance) | A string representation of the Record, used for overloading.
autocommit (public instance) | Whether to write changed rows back to the database as soon as possible.
_not_invalid |
_as_bool |
_delete |
commit |
refresh |
_update_content |
_fields |
_update_field |
associated (public instance) | Find Records in another table that have a foreign key that links back to this record.
## DBIx:: StORM:: Record
DBIx::StORM::Record
DBIx::StORM::Class
A StORM class representing an individual row from the database. This is essentially a wrapper for a result from a DBI statement handle. It appears to be a hash reference, where the keys of the hash are the column names in the result and the hash values are the column values. =end NaturalDocs Summary
Functions |
_new (private instance) | Create a new DBIx::StORM::Record object from the RecordSet.
_as_tied_hash (private instance) | Used by overloading to provide hash-reference access.
get (public instance) | Fetch a field from the Record.
_get_simple_value (private instance) | Fetch the scalar value of a “simple” (ie.
_build_column_information_for_get (private instance) | Turn a string column name into a fully qualified content path, and also check to see if it’s a foreign key lookup and fetch the result if so.
_as_string (private instance) | A string representation of the Record, used for overloading.
autocommit (public instance) | Whether to write changed rows back to the database as soon as possible.
_not_invalid |
_as_bool |
_delete |
commit |
refresh |
_update_content |
_fields |
_update_field |
associated (public instance) | Find Records in another table that have a foreign key that links back to this record.
### Functions ### _new (private instance) Create a new DBIx::StORM::Record object from the RecordSet. The Record may cover data from a lot of tables as it may have information for tables accessed as foreign keys. Therefore a result has a concept of “base reference” which is the access path to this result, which is used to index into the map of columns. #### Parameters
HashRef $params | Parameters to build the Record
#### Returns
Object | A new DBIx::StORM::Record object
=end NaturalDocs ### _as_tied_hash (private instance) Used by overloading to provide hash-reference access. The keys of this hash are the columns in the result (for this table only) and the values are the column values. #### Parameters None #### Returns
HashRef | A tied hash of the column information
=end NaturalDocs ### get (public instance) Fetch a field from the Record. The field is returned as an l-value, so you can assign to it. This is for people who don’t like the hash-reference style access. #### Parameters
$field | The field to fetch from the row
#### Returns
Tied scalar as an l-value | The scalar may be a reference, and is tied to class DBIx::StORM::TiedColumn
=end NaturalDocs ### _get_simple_value (private instance) Fetch the scalar value of a “simple” (ie. not foreign key) column. This is used by TiedColumn and TiedRecord. #### Parameters
$field | The qualified field to fetch
$raw_field | The string field name
#### Returns
Scalar | the column value, or undef on failure
=end NaturalDocs ### _build_column_information_for_get (private instance) Turn a string column name into a fully qualified content path, and also check to see if it’s a foreign key lookup and fetch the result if so. #### Parameters
$field | The string column name to fetch
#### Returns
Variable | undef on failure, one DBIx::StORM::Record on a foreign key lookup or a ($field, $raw_field) pair suitable for feeding to _get_simple_value for non-foreign columns.
=end NaturalDocs ### _as_string (private instance) A string representation of the Record, used for overloading. We stringify to the primary key where possible. This may sound perverse, but it means that print $result->{foreign_key}; gives you the foreign key value as you’d expect. It also makes for a reasonable serialisation. If there is no primary key we serialise in the standard Perl fashion. #### Parameters None #### Returns
String | a printable value for this result
> =end NaturalDocs ### autocommit (public instance) Whether to write changed rows back to the database as soon as possible. This is my default true for rows loaded from a table, and false before a new row is inserted. Auto committing can thrash the database with small queries if you make a lot of updates to a row quickly, so turning off autocommit will allow those changes to be written back with one query. #### Parameters None #### Returns Nothing =end NaturalDocs ### _not_invalid
> sub _not_invalid
> ### _as_bool
> sub _as_bool
> ### _delete
> sub _delete
> ### commit
> sub commit
> ### refresh
> sub refresh
> ### _update_content
> sub _update_content
> ### _fields
> sub _fields
> ### _update_field
> sub _update_field
### associated (public instance) Find Records in another table that have a foreign key that links back to this record. #### Parameters
String $table | Table to scan for links back to this record
#### Returns
Object | A DBIx::StORM::RecordSet of records with a column that match
=end NaturalDocs

> sub _not_invalid

> sub _as_bool

> sub _delete

> sub commit

> sub refresh

> sub _update_content

> sub _fields

> sub _update_field