Skip to content

Instantly share code, notes, and snippets.

@proofek
Last active December 18, 2015 16:18
Show Gist options
  • Save proofek/5809899 to your computer and use it in GitHub Desktop.
Save proofek/5809899 to your computer and use it in GitHub Desktop.
SupplierRelate.php - definition of the relationship without middle table (see https://gist.github.com/proofek/5809737 for the field definitions)
<?php
/*
* Relationship link
* * see the link defined on the name field above
* * relationship name matches the relationship defined below
*/
$dictionary['Demo_SupplierContactDetails']['fields']['demo_suppliers'] = array(
'name' => 'demo_suppliers',
'type' => 'link',
'relationship' => 'demo_suppliers_demo_suppliercontactdetails',
'module' => 'Demo_Suppliers',
'bean_name' => 'Demo_Suppliers',
'source' => 'non-db',
'vname' => 'LBL_SUPPLIERS',
);
/*
* Relationship definition
*/
$dictionary['Demo_SupplierContactDetails']['relationships']['demo_suppliers_demo_suppliercontactdetails'] = array(
'lhs_module' => 'Demo_SupplierContactDetails',
'lhs_table' => 'Demo_SupplierContactDetails',
'lhs_key' => 'demo_suppliers_id',
'rhs_module' => 'Demo_Suppliers',
'rhs_table' => 'Demo_Suppliers',
'rhs_key' => 'id',
'relationship_type' => 'one-to-many',
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment