Methods

All methods in the Solar_Sql_Model_Related class.

Public

__construct()

Constructor.

__destruct()

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

dump()

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

fetch()

Fetches the related record or collection for a native ID or record.

fetchEmpty()

Returns a new empty value appropriate for a lazy- or eager-fetch; this is different for each kind of related.

fetchNew()

Fetches a new record or collection object.

getForeignConditions()

Gets the foreign-model WHERE conditions and merges with the WHERE conditions on this relationship.

getModel()

Returns the related (foreign) model instance.

isInvalid()

Is the related record or collection valid?

isMany()

Is this related to many records?

isOne()

Is this related to one record?

load()

Loads this relationship object with user-defined characteristics (options), and corrects them as needed.

locale()

Looks up class-specific locale strings based on a key.

modEagerFetch()

Fixes the native fetch params and eager params; then, if the join_flag is set on the eager, calles _modEagerFetch() to modify the native fetch params based on the eager params.

modEagerResult()

Modifies the parent result array to add eager records.

newObject()

Packages foreign data as a record or collection object.

preSave()

Pre-save hook for saving related records or collections from a native record.

save()

Saves a related record or collection from a native record.

setNativeModel()

Sets the native (origin) model instance.

toArray()

Returns the relation characteristics as an array.

Protected

_buildConfig()

Builds and returns the default config for a class, including all configs inherited from its parents.

_collate()

Given a results array, collates the results based on a key within each result.

_exception()

Convenience method for returning exceptions with localized text.

_fetchIntoArrayAll()

Fetches eager results into an existing native array rowset.

_fetchIntoArrayOne()

Fetches eager results into an existing single native array row.

_fixEagerParams()

Fixes the eager params based on the settings for this related.

_fixFetchParams()

Fixes the native fetch params based on the settings for this related.

_fixForeignKey()

Corrects the foreign_key value in the options.

_fixRelatedCol()

Fixes the related column names in the user-defined options in place.

_getEmpty()

Returns an empty related value for an internal array result.

_getNativeBySelect()

Returns an INNER JOIN specification for joining to the native table as as sub-SELECT.

_getNativeByWherein()

Returns an array of WHERE conditions for selecting only certain native values from the foreign table using "WHERE IN (...)".

_modEagerFetch()

Modifies the native fetch with an eager join so that the foreign table is joined properly.

_postConfig()

A hook that activates after _buildConfig() in the constructor.

_postConstruct()

Post-construction tasks to complete object construction.

_preConfig()

A hook that activates before _buildConfig() in the constructor.

_setCols()

Sets the foreign columns to be selected based on user-defined relationship options.

_setConditions()

Sets additional conditions from the relationship definition; these are used in the WHERE and/or JOIN ON conditions.

_setForeignClass()

Sets the base name for the foreign class.

_setForeignModel()

Sets the foreign model instance based on user-defined relationship options.

_setMerge()

Sets the merge type.

_setNativeBy()

Sets the native-by strategy ('wherein' or 'select').

_setOrder()

Sets default ORDER clause from the relationship definition.

_setRelated()

Sets the characteristics for the related model, table, etc.

_setType()

Sets the relationship type.

_setWhereinMax()

Sets the 'wherein_max' value (i.e., the number of records in the native collection after which we should use a 'native-by select' strategy).

Private

None.



Local