Methods
All methods in the Solar_Sql_Model_Record class.
Public
-
__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.
Protected
-
_buildConfig() -
Builds and returns the default config for a class, including all configs inherited from its parents.
-
_exception() -
Convenience method for returning exceptions with localized text.
-
_fixRelatedData() -
Make sure our related data values are the right value and type.
-
_free() -
Recursively descends and calls free() on child structs.
-
_getInsertData() -
Gather values to insert into the DB for a new record.
-
_getInvalid() -
Support method to collect all validation failure messages for all properties and relateds.
-
_getUpdateData() -
Gather values to update into the DB.
-
_insert() -
Inserts the current record into the database, making calls to pre- and post-insert logic.
-
_load() -
Overridable method to load the struct with array data.
-
_loadAccessMethodsList() -
Loads the access method list for a given class.
-
_modInsert() -
Modify the current record before it is inserted into the DB.
-
_modUpdate() -
Modify the current record before it is updated into the DB.
-
_postConfig() -
A hook that activates after _buildConfig() in the constructor.
-
_postConstruct() -
Post-construction tasks to complete object construction.
-
_postDelete() -
User-defined post-delete logic.
-
_postFilter() -
User-defined logic executed after filters are applied to the record data.
-
_postInsert() -
User-defined post-insert logic.
-
_postSave() -
User-defined post-save logic.
-
_postSaveRelated() -
User-defined logic to execute after saving related records.
-
_postUpdate() -
User-defined post-update logic.
-
_preConfig() -
A hook that activates before _buildConfig() in the constructor.
-
_preDelete() -
User-defined pre-delete logic.
-
_preFilter() -
User-defined logic executed before filters are applied to the record data.
-
_preInsert() -
User-defined pre-insert logic.
-
_preSave() -
User-defined pre-save logic.
-
_preSaveRelated() -
User-defined logic to execute before saving related records.
-
_preUpdate() -
User-defined pre-update logic.
-
_save() -
Saves the current record, but only if the record is "dirty".
-
_saveRelated() -
Saves each related record.
-
_setAccessMethods() -
Sets the access method lists for this instance.
-
_setIsDirty() -
Marks the struct as dirty.
-
_setSqlStatus() -
Sets the SQL status of this record, resetting dirty/new/invalid as needed.
-
_toArray() -
Support method for toArray().
-
_update() -
Updates the current record at the database, making calls to pre- and post-update logic.
Private
None.