Methods
All methods in the Solar_Sql_Model class.
Public
-
__call() -
Magic call implements "fetchOneBy...()" and "fetchAllBy...()" for columns listed in the method name.
-
__construct() -
Constructor.
-
__destruct() -
Default destructor; does nothing other than provide a safe fallback for calls to parent::__destruct().
-
__get() -
Read-only access to protected model properties.
-
countPages() -
Fetches count and pages of available records.
-
delete() -
Deletes rows from the model table and deletes cache entries.
-
dump() -
Convenience method for getting a dump the whole object, or one of its properties, or an external variable.
-
fetch() -
Fetches a record or collection by primary key value(s).
-
fetchAll() -
Fetches a collection of all records by arbitrary parameters.
-
fetchAllAsArray() -
Fetches an array of rows by arbitrary parameters.
-
fetchAssoc() -
The same as fetchAll(), except the record collection is keyed on the first column of the results (instead of being a strictly sequential array.)
-
fetchAssocAsArray() -
The same as fetchAssoc(), except it returns an array, not a collection.
-
fetchCol() -
Fetches a sequential array of values from the model, using only the first column of the results.
-
fetchNew() -
Returns a new record with default values.
-
fetchOne() -
Fetches one record by arbitrary parameters.
-
fetchOneAsArray() -
The same as fetchOne(), but returns an array instead of a record object.
-
fetchPairs() -
Fetches an array of key-value pairs from the model, where the first column is the key and the second column is the value.
-
fetchValue() -
Fetches a single value from the model (i.e., the first column of the first record of the returned page set).
-
free() -
Call this before you unset the instance so that you release the memory from all the internal child objects.
-
getAffectedRows() -
Returns the number of rows affected by the last INSERT, UPDATE, or DELETE.
-
getConditions() -
Returns a WHERE clause array of conditions to use when fetching from this model; e.g., single-table inheritance.
-
getPaging() -
Gets the number of records per page.
-
getPrimary() -
Returns the fully-qualified primary key name.
-
getRelated() -
Gets the control object for a named relationship.
-
insert() -
Inserts one row to the model table and deletes cache entries.
-
isInherit() -
Does this model have single-table inheritance values?
-
locale() -
Looks up class-specific locale strings based on a key.
-
newCollection() -
Returns the appropriate collection object for this model.
-
newRecord() -
Returns the appropriate record object, honoring inheritance.
-
newSelect() -
Returns a new Solar_Sql_Select tool, with the proper SQL object injected automatically.
-
serializeCols() -
Serializes data values in-place based on $this->_serialize_cols and $this->_xmlstruct_cols.
-
setPaging() -
Sets the number of records per page.
-
unserializeCols() -
Un-serializes data values in-place based on $this->_serialize_cols and $this->_xmlstruct_cols.
-
update() -
Updates rows in the model table and deletes cache entries.
Protected
-
_addFilter() -
Adds a column filter.
-
_addRelated() -
Support method for adding relations.
-
_belongsTo() -
Adds a named belongs-to relationship.
-
_buildConfig() -
Builds and returns the default config for a class, including all configs inherited from its parents.
-
_createTableAndIndexes() -
Creates the table and indexes in the database using $this->_table_cols and $this->_index_info.
-
_exception() -
Convenience method for returning exceptions with localized text.
-
_fetchNewData() -
Support method to generate the data for a new, blank record.
-
_fetchResultSelect() -
Returns a data result and the select used to fetch the data.
-
_fixArrayName() -
Fixes the array-name for this model.
-
_fixCache() -
Fixes the cache class name.
-
_fixCalculateCols() -
Fix $_calculate_cols to make it look like $_table_cols.
-
_fixCols() -
Fixes column info arrays to have a base set of keys.
-
_fixFetchParams() -
Converts and cleans-up fetch params from arrays to instances of Solar_Sql_Model_Params_Fetch.
-
_fixFilterClass() -
Fix the $_filter_class property.
-
_fixFilterCols() -
Adds filters for a given set of columns.
-
_fixFilters() -
Fixes the $_filters array property.
-
_fixIndexInfo() -
Fixes $this->_index_info listings.
-
_fixModelName() -
Fixes the model-name and table-alias for user input to this model.
-
_fixPrimaryCol() -
Sets $_primary_col if not already set.
-
_fixPropertyCols() -
Fixes up special column indicator properties, and post-sets the $_inherit_name value based on the existence of the inheritance column.
-
_fixStack() -
Fixes the stack of parent classes for the model.
-
_fixTableCols() -
Fixes table column definitions in $_table_cols.
-
_fixTableName() -
Loads table name into $this->_table_name, and pre-sets the value of $this->_inherit_name based on the class name.
-
_hasMany() -
Adds a named has-many relationship.
-
_hasManyThrough() -
Adds a named has-many through relationship.
-
_hasOne() -
Adds a named has-one relationship.
-
_hasOneOrNull() -
Adds a named has-one-or-none relationship.
-
_newCollection() -
Returns a new collection object for this model only.
-
_newRecord() -
Returns a new record object for this model only.
-
_postConfig() -
A hook that activates after _buildConfig() in the constructor.
-
_postConstruct() -
Post-construction tasks to complete object construction.
-
_postSetup() -
Complete the setup of this model.
-
_preConfig() -
A hook that activates before _buildConfig() in the constructor.
-
_preSetup() -
Establish state of this object prior to _setup().
-
_setCollectionPagerInfo() -
Sets the pager info in a collection, calling countPages() along the way.
-
_setup() -
User-defined setup.
Private
None.