Properties

Properties existing in the Solar_Sql_Model_Related class.

Public

$cols

(string|array) Fetch these columns for the related records.

$conditions

(string|array) Additional conditions when fetching related records.

$foreign_alias

(string) Aliases the foreign table to this name.

Default is the relationship name.

$foreign_class

(string) The class name of the foreign model.

Default is the first matching class for the relationship name, as loaded from the parent class stack.

$foreign_col

(string) The name of the column to join with in the foreign table.

This forms one-half of the relationship. Default is per association type.

$foreign_key

(string) The virtual element called foreign_key automatically populates the native_col or foreign_col value for you, based on the association type.

This will be used only when native_col and foreign_col are not set.

$foreign_name

(string) The virtual element called foreign_name automatically sets the foreign_class by looking up the foreign_name in the model catalog.

The virtual element is used only when foreign_class is not set.

$foreign_primary_col

(string) The name of the foreign primary column.

$foreign_table

(string) The name of the table for the foreign model.

Default is the table specified by the foreign model.

$merge

(string) Indicates the strategy to use for merging joined rows; 'server' means the database will do it via a single SELECT combined into the native fetch, whereas 'client' means PHP will do it, using one additional SELECT for the relationship.

$name

(string) The name of the relationship as defined by the original (native) model.

$native_alias

(string) The alias for the native table.

$native_by

(string) What strategy should be used for connecting to native records when eager-fetching: 'wherein', meaning a "WHERE IN (...)" a list of native IDs, or 'select', meaning a join against a sub-SELECT.

$native_class

(string) The class of the native model.

$native_col

(string) The native column to match against the foreign primary column.

$order

(string|array) Additional ORDER clauses when fetching related records.

$type

(string) The type of the relationship as defined by the original (native) model; e.g., 'has_one', 'belongs_to', 'has_many'.

$wherein_max

(string) When picking a native-by strategy, use 'wherein' for up to this many record in the native result; after this point, use a 'select' strategy.

Protected

$_config

(array) Collection point for configuration values.

Inherited from Solar_Base.

Note that you do not define config defaults in $_config directly.

<?php
// DO NOT DO THIS
protected $_config = array(
    'foo' => 'bar',
    'baz' => 'dib',
);

Instead, define config defaults in a protected property named for the class, withan underscore prefix.

For exmple, a "Vendor_Class_Name" class would define the default config array in "$_Vendor_Class_Name". This convention lets child classes inherit parent config keys and values.

<?php
// DO THIS INSTEAD
protected $_Vendor_Class_Name = array(
    'foo' => 'bar',
    'baz' => 'dib',
);

$_foreign_model

(Solar_Sql_Model) An instance of the foreign (related) model.

$_inflect

(Solar_Inflect) The registered Solar_Inflect object.

$_native_model

(Solar_Sql_Model) An instance of the native (origin) model that defined this relationship.

Private

None.



Local