Constructor
-
ActiveRecord_Base
$record: An instance of the class the association is being added to
-
ActiveRecord_Proxy
$proxy: A proxy for the class to allow limited access to protected methods
-
string
$name: The association name
-
array
$options: Options for the association
Add an associated object to this object's collection. This method handles database updates and foreign keys. It does not directly affect the contents of an association collection object.
-
ActiveRecord_Base
$record: An instance of the class the association is being added to
-
ActiveRecord_Proxy
$proxy: A proxy for the class to allow limited access to protected methods
-
object
$value: The new object to associate with our record
Check the associates to make sure they have been saved
void
after_create
( $record)
Check the associates to make sure they have been saved
void
after_save
( $record)
Build a new associated object from an associative array of attributes and assign it to the object. This method handles database updates and foreign keys. It does not directly affect the contents of an association collection object.
-
ActiveRecord_Base
$record: An instance of the class the association is being added to
-
ActiveRecord_Proxy
$proxy: A proxy for the class to allow limited access to protected methods
-
array
$attributes: The attributes for the new object to associate with our record
Called by the collection object to count the associated objects without loading them.
-
ActiveRecord_Base
$record: An instance of the class the association is being added to
-
ActiveRecord_Proxy
$proxy: A proxy for the class to allow limited access to protected methods
Create and save a new associated object from an associative array of attributes and assign it to the object. This method handles database updates and foreign keys. It does not directly affect the contents of an association collection object.
-
ActiveRecord_Base
$record: An instance of the class the association is being added to
-
ActiveRecord_Proxy
$proxy: A proxy for the class to allow limited access to protected methods
-
array
$attributes: The attributes for the new object to associate with our record
Implements the 'include' behavior for a find operation
void
do_include
( &$results, array $results)
-
array
$results: The result set to process
-
&$results
Redefinition of:
- ActiveRecord_Association::do_include()
- Implements the 'include' behavior for a find operation
Similar to ActiveRecord_Base::find_all(), but limited to items within this collection.
-
ActiveRecord_Base
$record: The record object this operation is being performed on
-
ActiveRecord_Proxy
$proxy: A proxy for the class to allow limited access to protected methods
-
array
$options: The options for the find operation
Accessor method for the associated objects
-
ActiveRecord_Base
$record: An instance of the class the association is being added to
-
ActiveRecord_Proxy
$proxy: A proxy for the class to allow limited access to protected methods
-
boolean
$force_reload: If true, forces reloading of the object even if it's cached
Accessor method for the associated object ids
-
ActiveRecord_Base
$record: An instance of the class the association is being added to
-
ActiveRecord_Proxy
$proxy: A proxy for the class to allow limited access to protected methods
Called by the collection object to load the actual associated objects.
-
ActiveRecord_Base
$record: An instance of the class the association is being added to
-
ActiveRecord_Proxy
$proxy: A proxy for the class to allow limited access to protected methods
Return the primary key name for this association
string
primary_key
()
Remove an associated object from this object's collection. This method handles database updates and foreign keys. It does not directly affect the contents of an association collection object.
-
ActiveRecord_Base
$record: An instance of the class the association is being removed from
-
ActiveRecord_Proxy
$proxy: A proxy for the class to allow limited access to protected methods
-
object
$value: The object to remove from our collection
Mutator method for the entire collection of associated objects
-
ActiveRecord_Base
$record: The instance of the class the association is being set on
-
ActiveRecord_Proxy
$proxy: A proxy for the class to allow limited access to protected methods
-
array
$values: The new objects to associate with our record
-
boolean
$skipKeyUpdates: This flag exists for include operations assigning associated objects for caching. When this flag is true, the normal foreign key assignment and update steps are skipped and the object is merely placed in the cache.
Mutator method for the entire collection of associated objects by ids
-
ActiveRecord_Base
$record: The instance of the class the association is being set on
-
ActiveRecord_Proxy
$proxy: A proxy for the class to allow limited access to protected methods
-
array
$values: The new object ids to associate with our record
Inherited Methods
Inherited From ActiveRecord_Association
ActiveRecord_Association::class_name()
ActiveRecord_Association::do_include()
ActiveRecord_Association::foreign_key()
ActiveRecord_Association::name()