Relationships Array The relationships array is used to specify relationships between Beans. Like the Indices array entries, it is a list of names with array values. • 'lhs_module' = The module on the left hand side of the relationship • 'lhs_table' = The table on the left hand side of the relationship • 'lhs_key' = The primary key column of the left hand side of the relationship • 'rhs_module' = The module on the right hand side of the relationship • 'rhs_table' = The table on the right hand side of the relationship • 'rhs_key' = The primary key column of the right hand side of the relationship • 'relationship_type' = The type of relationship ('one-to-many' or 'many-to-many') • ‘relationship_role_column’ = The type of relationship role • 'relationship_role_column_value' = Defines the unique identifier for the relationship role The following example creates a reporting relationship between a contact and the person that they report to. The reports_to_id field is used to map to the id field in the contact of the person they report to. This is a one-to-many relationship in that each person is only allowed to report to one person. Each person is allowed to have an unlimited number of direct reports. 'contact_direct_reports' => array( 'lhs_module' => 'Contacts', 'lhs_table' => 'contacts', 'lhs_key' => 'id', 'rhs_module' => 'Contacts', 'rhs_table' => 'contacts', 'rhs_key' => 'reports_to_id', 'relationship_type' => 'one-to-many'),
Copyright 2004-2008 SugarCRM Inc. Product License