Properties
Properties existing in the Solar_Sql_Model_Related_HasOneOrNull
class.
Public
$cols
(string|array) Fetch these columns for the related records.
Inherited from Solar_Sql_Model_Related.
$conditions
(string|array) Additional conditions when fetching related records.
Inherited from Solar_Sql_Model_Related.
$foreign_alias
(string) Aliases the foreign table to this name.
Inherited from Solar_Sql_Model_Related.
Default is the relationship name.
$foreign_class
(string) The class name of the foreign model.
Inherited from Solar_Sql_Model_Related.
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.
Inherited from Solar_Sql_Model_Related.
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.
Inherited from Solar_Sql_Model_Related.
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.
Inherited from Solar_Sql_Model_Related.
The virtual element is used only when foreign_class is not set.
$foreign_primary_col
(string) The name of the foreign primary column.
Inherited from Solar_Sql_Model_Related.
$foreign_table
(string) The name of the table for the foreign model.
Inherited from Solar_Sql_Model_Related.
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.
Inherited from Solar_Sql_Model_Related.
$name
(string) The name of the relationship as defined by the original (native) model.
Inherited from Solar_Sql_Model_Related.
$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.
Inherited from Solar_Sql_Model_Related.
$native_col
(string) The native column to match against the foreign primary column.
Inherited from Solar_Sql_Model_Related.
$order
(string|array) Additional ORDER clauses when fetching related records.
Inherited from Solar_Sql_Model_Related.
$type
(string) The type of the relationship as defined by the original (native) model; e.g., 'has_one', 'belongs_to', 'has_many'.
Inherited from Solar_Sql_Model_Related.
$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.
Inherited from Solar_Sql_Model_Related.
Protected
$_Solar_Sql_Model_Related
(array) User-defined configuration values.
Inherited from Solar_Sql_Model_Related.
$_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.
Inherited from Solar_Sql_Model_Related.
$_inflect
(Solar_Inflect) The registered Solar_Inflect object.
Inherited from Solar_Sql_Model_Related.
$_native_model
(Solar_Sql_Model) An instance of the native (origin) model that defined this relationship.
Inherited from Solar_Sql_Model_Related.
Private
None.