DBIx:: StORM:: Record
Summary
DBIx:: StORM:: Record
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
_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
Returns
=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
Returns
=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
Returns
=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. ParametersNone Returns
=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. ParametersNone ReturnsNothing =end NaturalDocs |
sub _not_invalid
sub _as_bool
sub _delete
sub commit
sub refresh
sub _update_content
sub _fields
sub _update_field