[ Index ]

PHP Cross Reference of Akelos Framework

title

Body

[close]

/AkActiveRecord/ -> AkAssociatedActiveRecord.php (summary)

(no description)

Author: Bermi Ferrer
Copyright: Copyright (c) 2002-2006, Akelos Media, S.L. http://www.akelos.org
License: GNU Lesser General Public License
File Size: 442 lines (18 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 1 file
 AkBaseModel.php

Defines 1 class

AkAssociatedActiveRecord:: (29 methods):
  _loadAssociationHandler()
  setAssociationHandler()
  loadAssociations()
  getAssociated()
  getId()
  assign()
  build()
  create()
  replace()
  find()
  load()
  constructSql()
  constructSqlForInclusion()
  getAssociatedFinderSqlOptions()
  getAssociationOption()
  setAssociationOption()
  getAssociationId()
  getAssociatedIds()
  getAssociatedHandlerName()
  getAssociatedType()
  getAssociationType()
  getType()
  hasAssociations()
  findWithAssociations()
  getCollectionHandlerName()
  constructFinderSqlWithAssociations()
  _findBySqlWithAssociations()
  _generateObjectGraphFromResultSet()
  _addTableAliasesToAssociatedSql()


Class: AkAssociatedActiveRecord  - X-Ref

association(force_reload = false) - returns the associated object. Nil is returned if none is found.
association=(associate) - assigns the associate object, extracts the primary key, sets it as the foreign key, and saves the associate object.
association.nil? - returns true if there is no associated object.
build_association(attributes = {}) - returns a new object of the associated type that has been instantiated with attributes and linked to this object through a foreign key but has not yet been saved. Note: This ONLY works if an association already exists. It will NOT work if the association is nil.
create_association(attributes = {}) - returns a new object of the associated type that has been instantiated with attributes and linked to this object through a foreign key and that has already been saved (if it passed the validation).
Account#beneficiary (similar to Beneficiary.find(:first, :conditions => "account_id = #{id}"))
Account#beneficiary=(beneficiary) (similar to beneficiary.account_id = account.id; beneficiary.save)
Account#beneficiary.nil?
Account#build_beneficiary (similar to Beneficiary.new("account_id" => id))
Account#create_beneficiary (similar to b = Beneficiary.new("account_id" => id); b.save; b)

_loadAssociationHandler($association_type)   X-Ref
No description

setAssociationHandler(&$AssociationHandler, $association_id)   X-Ref
No description

loadAssociations()   X-Ref
No description

getAssociated($association_type)   X-Ref
Gets an array of associated object of selected association type.


getId()   X-Ref
No description

assign(&$Associated)   X-Ref
No description

build($attributes = array()   X-Ref
Returns a new object of the associated type that has been instantiated with attributes
and linked to this object through a foreign key but has not yet been saved.


create($attributes = array()   X-Ref
No description

replace(&$NewAssociated, $dont_save = false)   X-Ref
No description

find()   X-Ref
No description

load()   X-Ref
No description

constructSql()   X-Ref
No description

constructSqlForInclusion()   X-Ref
No description

getAssociatedFinderSqlOptions($options = array()   X-Ref
No description

getAssociationOption($option)   X-Ref
No description

setAssociationOption($option, $value)   X-Ref
No description

getAssociationId()   X-Ref
No description

getAssociatedIds()   X-Ref
No description

getAssociatedHandlerName($association_id)   X-Ref
No description

getAssociatedType()   X-Ref
No description

getAssociationType()   X-Ref
No description

getType()   X-Ref
No description

hasAssociations()   X-Ref
No description

findWithAssociations($options)   X-Ref
No description

getCollectionHandlerName($association_id)   X-Ref
No description

constructFinderSqlWithAssociations($options, $include_owner_as_selection = true)   X-Ref
Used for generating custom selections for habtm, has_many and has_one queries


_findBySqlWithAssociations($sql, $included_associations = array()   X-Ref


_generateObjectGraphFromResultSet($results,$included_associations = array()   X-Ref
Pass hand-made sql directly to _db->execute and generate the OG with this method.

param: ADOResultSet $results            a result set from Db->execute
param: array $included_associations     just like in ->find(); $options['include']; but in fact unused
param: mixed $virtual_limit             int or false; unsure if this works                     
return: array                           ObjectGraph as an array

_addTableAliasesToAssociatedSql($table_alias, $sql)   X-Ref
No description



Generated: Mon Oct 27 12:43:49 2008 Cross-referenced by PHPXref 0.6