Class AutoCRUD_Relationship

Description

AutoCRUD_Relationship Class

This class is used to handle the joins and relationships between tables

Located in /relationship.inc.php (line 18)


	
			
Method Summary
AutoCRUD_Relationship AutoCRUD_Relationship (AutoCRUD_CRUD &$owner, AutoCRUD_CRUD &$other)
array doJoin (array $results)
string getOtherField ()
string getOwnerField ()
string getReverseType ()
string getType ()
array joinMany2Many (array $results, string $table)
void setFields (string $owner, string $other)
mixed setType (string $type)
Methods
Constructor AutoCRUD_Relationship (line 41)

Used to pass in the owner CRUD object and the CRUD object of the other table

  • access: public
AutoCRUD_Relationship AutoCRUD_Relationship (AutoCRUD_CRUD &$owner, AutoCRUD_CRUD &$other)
createReverseRelationship (line 174)

Used to add a relationship on the other CRUD object type (in reverse)

  • access: public
void createReverseRelationship ()
doJoin (line 63)

Used to get related records of a result set

  • return: the result set with related records
  • access: public
array doJoin (array $results)
  • array $results: the result set (an array of records)
getOther (line 191)

Returns the other CRUD object

  • access: public
AutoCRUD_CRUD &getOther ()
getOtherField (line 219)

Returns the field of the other table

  • access: public
string getOtherField ()
getOwner (line 184)

Returns the owner CRUD object

  • access: public
AutoCRUD_CRUD &getOwner ()
getOwnerField (line 212)

Returns the field of the owner table

  • access: public
string getOwnerField ()
getReverseType (line 273)

Returns the reverse relationship type (e.g. many-to-one when the relationship type is one-to-many)

  • access: public
string getReverseType ()
getType (line 264)

Returns the relationship type

  • access: public
string getType ()
joinMany2Many (line 83)

Used to get related records of a result set in a Many-to-Many relationship

  • return: the result set with related records
  • access: public
array joinMany2Many (array $results, string $table)
  • array $results: the result set (an array of records)
  • string $table: the name of the other table
setFields (line 200)

Used to set the fields used in the relationship

  • access: public
void setFields (string $owner, string $other)
  • string $owner: name of the owner field
  • string $other: name of the other field
setType (line 229)

Used to set the type of relationship

  • return: true on success, error object on failure
  • access: public
mixed setType (string $type)
  • string $type: the type of relationship, valid types are one-to-one, many-to-one, one-to-many, many-to-many and child-parent

Documentation generated on Wed, 14 Jun 2006 14:08:44 +0200 by phpDocumentor 1.3.0RC4