wCMF  3.6
 All Classes Namespaces Files Functions Variables Groups Pages
class.NMUserRoleRDBMapper.php
Go to the documentation of this file.
1 <?php
2 /**
3  * This file was generated by wCMFGenerator 2.6.1.0033 from cookbook1.xmi on 23.02.09 21:34.
4  * Manual modifications should be placed inside the protected regions.
5  */
6 require_once(BASE."wcmf/lib/model/mapper/class.NodeUnifiedRDBMapper.php");
7 require_once(BASE."application/include/model/wcmf/class.NMUserRole.php");
8 
9 /**
10  * @class NMUserRoleRDBMapper
11  * NMUserRoleRDBMapper maps NMUserRole Nodes to the database.
12  * NMUserRole description:
13  *
14  * @author <ingo@wemove.com>
15  * @version 1.0
16  */
18 {
19  /**
20  * @see RDBMapper::getType()
21  */
22  function getType()
23  {
24  return 'NMUserRole';
25  }
26  /**
27  * @see NodeRDBMapper::createObject()
28  */
29  function &createObject($oid=null)
30  {
31  return new NMUserRole($oid);
32  }
33  /**
34  * @see NodeUnifiedRDBMapper::getTableName()
35  */
36  function getTableName()
37  {
38  return 'nm_user_role';
39  }
40  /**
41  * @see PersistenceMapper::getPkNames()
42  */
43  function getPkNames()
44  {
45  return array('fk_user_id' => DATATYPE_IGNORE, 'fk_role_id' => DATATYPE_IGNORE);
46  }
47  /**
48  * @see NodeUnifiedRDBMapper::getMyFKColumnNameImpl()
49  */
50  function getMyFKColumnNameImpl($parentType)
51  {
52  if ($parentType == 'RoleRDB') return 'fk_role_id';
53  if ($parentType == 'UserRDB') return 'fk_user_id';
54  if ($this->getType() == 'NMUserRole' && $parentType == 'RoleRDB') return 'fk_role_id';
55  if ($this->getType() == 'NMUserRole' && $parentType == 'UserRDB') return 'fk_user_id';
56  return '';
57  }
58  /**
59  * @see NodeUnifiedRDBMapper::getOrderBy()
60  */
61  function getOrderBy()
62  {
63  return array();
64  }
65  /**
66  * @see NodeUnifiedRDBMapper::getObjectDefinitionImpl()
67  */
69  {
70  $nodeDef = array();
71  $nodeDef['_properties'] = array
72  (
73  array('name' => 'manyToMany', 'value' => array('RoleRDB', 'UserRDB')),
74  array('name' => 'is_searchable', 'value' => false),
75 // PROTECTED REGION ID(application/include/model/wcmf/class.NMUserRoleRDBMapper.php/Properties) ENABLED START
76 // PROTECTED REGION END
77  );
78  $nodeDef['_datadef'] = array
79  (
80  /*
81  * Value description:
82  */
83  array('name' => 'fk_user_id', 'app_data_type' => DATATYPE_IGNORE, 'column_name' => 'fk_user_id', 'db_data_type' => 'INT(11)', 'default' => '', 'restrictions_match' => '', 'restrictions_not_match' => '', 'restrictions_description' => '', 'is_editable' => false, 'input_type' => 'text', 'display_type' => 'text'),
84  /*
85  * Value description:
86  */
87  array('name' => 'fk_role_id', 'app_data_type' => DATATYPE_IGNORE, 'column_name' => 'fk_role_id', 'db_data_type' => 'INT(11)', 'default' => '', 'restrictions_match' => '', 'restrictions_not_match' => '', 'restrictions_description' => '', 'is_editable' => false, 'input_type' => 'text', 'display_type' => 'text'),
88  );
89  $nodeDef['_ref'] = array
90  (
91  );
92  $nodeDef['_parents'] = array
93  (
94  array('type' => 'RoleRDB', 'is_navigable' => true, 'table_name' => 'role', 'pk_columns' => array('id'), 'fk_columns' => 'fk_role_id'),
95  array('type' => 'UserRDB', 'is_navigable' => true, 'table_name' => 'user', 'pk_columns' => array('id'), 'fk_columns' => 'fk_user_id')
96  );
97  $nodeDef['_children'] = array
98  (
99  );
100  return $nodeDef;
101  }
102 }
103 ?>
const DATATYPE_IGNORE
NodeUnifiedRDBMapper maps Node objects to a relational database schema where each Node type has its o...