Skip to content

Instantly share code, notes, and snippets.

@proofek
Created July 25, 2013 15:56
Show Gist options
  • Save proofek/6081152 to your computer and use it in GitHub Desktop.
Save proofek/6081152 to your computer and use it in GitHub Desktop.
Fields definitions for a relate field implemented using 1-2-many relationship
<?php
'releted_user_id' => array(
'name' => 'releted_user_id',
'rname' => 'user_name',
'id_name' => 'releted_user_id',
'vname' => 'LBL_USER_ID',
'type' => 'relate',
'table' => 'users',
'module' => 'Users',
'reportable' => false,
'isnull' => 'true',
'dbType' => 'id',
'audited' => true,
'reportable' => false,
'duplicate_merge' => 'disabled',
'massupdate' => false,
),
'releted_user_name' => array(
'name' => 'releted_user_name',
'required' => true,
'link' => 'releted_user_link',
'vname' => 'LBL_REQUESTED_BY',
'rname' => 'name',
'type' => 'relate',
'reportable' => false,
'source' => 'non-db',
'table' => 'users',
'id_name' => 'releted_user_id',
'module' => 'Users',
'duplicate_merge' => 'disabled',
),
'releted_user_link' => array(
'name' => 'releted_user_link',
'type' => 'link',
'relationship' => 'accounts_releted_user',
'vname' => 'LBL_REQUESTED_BY',
'link_type' => 'one',
'module' => 'Users',
'bean_name' => 'User',
'source' => 'non-db',
'rname' => 'user_name',
'id_name' => 'releted_user_id',
'table' => 'users',
),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment