Overview

Represents a single record returned from a Solar_Sql_Model.

Package

This class is part of the Solar_Sql_Model package.

Inheritance:

Configuration Keys

  • data: Key-value pairs.

Constants

Public Properties

The Solar_Sql_Model_Record class has no public properties; try the list of all properties.

Public Methods

These are all the public methods in the Solar_Sql_Model_Record class.

You can also view the list of all public, protected, and private methods.

__construct()

Constructor.

__destruct()

Default destructor; does nothing other than provide a safe fallback for calls to parent::__destruct().

__get()

Magic getter for record properties; automatically calls __getColName() methods when they exist.

__isset()

Checks if a data key is set.

__set()

Magic setter for record properties; automatically calls __setColName() methods when they exist.

__toString()

Returns a string representation of the object.

__unset()

Sets a key in the data to null.

addFilter()

Adds a column filter to this record instance.

count()

Countable: how many keys are there?

delete()

Deletes this record from the database.

dump()

Convenience method for getting a dump of the record, or one of its properties, or an external variable.

filter()

Filter the data.

free()

Frees memory used by this struct.

getChanged()

Gets a list of all changed table columns.

getInvalid()

Returns the validation failure message for one or more properties, including the messages on related records and collections.

getIterator()

IteratorAggregate: returns an external iterator for this struct.

getKeys()

Returns all the keys for this struct.

getModel()

Returns the model from which the data originates.

getPrimaryCol()

Gets the name of the primary-key column.

getPrimaryVal()

Gets the value of the primary-key column.

getSaveException()

Returns the exception (if any) generated by the most-recent call to the save() method.

getSqlStatus()

Returns the SQL status of this record at the database.

increment()

Increments the value of a column immediately at the database and retains the incremented value in the record.

init()

Initialize the record object.

initNew()

Initialize the record object as a "new" record; as with init(), this is effectively a "first load" method.

isChanged()

Tells if the record, or a particular table-column in the record, has changed from its initial value.

isDeleted()

Has this record been deleted?

isDirty()

Is the struct dirty?

isInvalid()

Is the record or one of its relateds invalid?

isNew()

Is the record new?

load()

Loads the struct with data from an array or another struct.

locale()

Overrides normal locale() to use the model locale strings.

newFilter()

Returns a new filter object with the filters from the record model.

newForm()

Returns a new Solar_Form object pre-populated with column properties, values, and filters ready for processing (all based on the model for this record).

newRelated()

Create a new record/collection related to this one and returns it.

offsetExists()

ArrayAccess: does the requested key exist?

offsetGet()

ArrayAccess: get a key value.

offsetSet()

ArrayAccess: set a key value.

offsetUnset()

ArrayAccess: unset a key.

refresh()

Refreshes data for this record from the database.

save()

Saves this record and all related records to the database, inserting or updating as needed.

saveInTransaction()

Perform a save() within a transaction, with automatic commit and rollback.

setInvalid()

Forces one property to be "invalid" and sets a validation failure message for it.

setInvalids()

Forces multiple properties to be "invalid" and sets validation failure message for them.

setNewRelated()

Sets the related to be a new record/collection, but only if the related is empty.

toArray()

Converts the properties of this model Record or Collection to an array, including related models stored in properties and calculated columns.

toString()

Returns a string representation of the struct.



Local