Methods
All methods in the Solar_Sql_Model_Related_HasOne
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 record when there is no related data.
-
fetchNew()
-
Fetches a new related record.
-
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()
-
Returns foreign data as a record object.
-
preSave()
-
Pre-save hook for saving related records or collections from a native record.
-
save()
-
Saves a related record 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()
-
Collates a result array by an array key, grouping the results by that value.
-
_emergeFromArrayAll()
-
Pulls server-merged foreign columns from the native results and puts them into their own sub-array within each of the many native rows.
-
_emergeFromArrayOne()
-
Pulls server-merged foreign columns from the native results and puts them into their own sub-array within the one native row.
-
_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; uses the native-model table name as singular.
-
_fixRelatedCol()
-
Fixes the related column names in the user-defined eager 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 and foreign columns are selected.
-
_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; assumes the related name is is singular and inflects it to plural.
-
_setForeignModel()
-
Sets the foreign model instance based on user-defined relationship options.
-
_setMerge()
-
Sets the merge type; defaults to 'server' merges.
-
_setNativeBy()
-
Sets the native-by strategy ('wherein' or 'select').
-
_setOrder()
-
Sets default ORDER clause from the relationship definition.
-
_setRelated()
-
A support method for _fixRelated() to handle has-one relationships.
-
_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.