wCMF  3.6
 All Classes Namespaces Files Functions Variables Groups Pages
class.NMUserRoleBase.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/class.Node.php");
7 
8 /**
9  * @class NMUserRole
10  * NMUserRole description:
11  *
12  * @author <ingo@wemove.com>
13  * @version 1.0
14  */
15 class NMUserRoleBase extends Node
16 {
17  function NMUserRoleBase($oid=null, $type=null)
18  {
19  if ($type == null)
20  parent::Node('NMUserRole', $oid);
21  else
22  parent::Node($type, $oid);
23  }
24  /**
25  * @see PersistentObject::getObjectDisplayName()
26  */
28  {
29  return Message::get("NMUserRole");
30  }
31  /**
32  * @see PersistentObject::getObjectDescription()
33  */
35  {
36  return Message::get("");
37  }
38  /**
39  * @see PersistentObject::getValueDisplayName()
40  */
41  function getValueDisplayName($name, $type=null)
42  {
43  $displayName = $name;
44  if ($name == 'fk_user_id') $displayName = Message::get("fk_user_id");
45  if ($name == 'fk_role_id') $displayName = Message::get("fk_role_id");
46  return Message::get($displayName);
47  }
48  /**
49  * @see PersistentObject::getValueDescription()
50  */
51  function getValueDescription($name, $type=null)
52  {
53  $description = $name;
54  if ($name == 'fk_user_id') $description = Message::get("");
55  if ($name == 'fk_role_id') $description = Message::get("");
56  return Message::get($description);
57  }
58  /**
59  * See if the node is an association object, that implements a many to many relation
60  */
61  function isManyToManyObject()
62  {
63  return true;
64  }
65  /**
66  * Getter/Setter
67  */
68  function getFkUserId($unconverted=false)
69  {
70  if ($unconverted)
71  return $this->getUnconvertedValue('fk_user_id', DATATYPE_IGNORE);
72  else
73  return $this->getValue('fk_user_id', DATATYPE_IGNORE);
74  }
75  function setFkUserId($fk_user_id)
76  {
77  return $this->setValue('fk_user_id', $fk_user_id, DATATYPE_IGNORE);
78  }
79  function getFkRoleId($unconverted=false)
80  {
81  if ($unconverted)
82  return $this->getUnconvertedValue('fk_role_id', DATATYPE_IGNORE);
83  else
84  return $this->getValue('fk_role_id', DATATYPE_IGNORE);
85  }
86  function setFkRoleId($fk_role_id)
87  {
88  return $this->setValue('fk_role_id', $fk_role_id, DATATYPE_IGNORE);
89  }
90  function getRoleRDBOID()
91  {
92  $fkValue = $this->getValue('fk_role_id', DATATYPE_IGNORE);
93  if ($fkValue != null)
94  return PersistenceFacade::composeOID(array('type' => 'RoleRDB', 'id' => array($fkValue)));
95  else
96  return null;
97  }
98  function setRoleRDB(&$node)
99  {
100  if ($node != null)
101  $this->setValue('fk_role_id', $node->getDBID(), DATATYPE_IGNORE);
102  }
103  function getUserRDBOID()
104  {
105  $fkValue = $this->getValue('fk_user_id', DATATYPE_IGNORE);
106  if ($fkValue != null)
107  return PersistenceFacade::composeOID(array('type' => 'UserRDB', 'id' => array($fkValue)));
108  else
109  return null;
110  }
111  function setUserRDB(&$node)
112  {
113  if ($node != null)
114  $this->setValue('fk_user_id', $node->getDBID(), DATATYPE_IGNORE);
115  }
116  function getRoleRDBParents()
117  {
118  return $this->getParentsEx(null, 'RoleRDB', null, null);
119  }
120  function getUserRDBParents()
121  {
122  return $this->getParentsEx(null, 'UserRDB', null, null);
123  }
124 
125  /**
126  * Node class overrides
127  */
128 
129  /**
130  * @see Node::loadChildren()
131  * Override this to also load the children of many-to-many relations
132  */
133  function loadChildren($type, $buildDepth=BUILDDEPTH_SINGLE, $forceUpdate=false)
134  {
135  // do default
136  parent::loadChildren($type, $buildDepth, $forceUpdate);
137  }
138  /**
139  * @see Node::getChildrenEx()
140  * Override this to also get the children of many-to-many relations
141  */
142  function getChildrenEx($oid, $type, $values, $properties)
143  {
144  // do default
145  return parent::getChildrenEx($oid, $type, $values, $properties);
146  }
147  /**
148  * @see Node::addChild()
149  * Override this to insert association objects if necessary
150  */
151  function addChild(&$child, $addtype=ADDCHILD_BACK)
152  {
153  // do default
154  parent::addChild($child, $addtype);
155  }
156  /**
157  * @see Node::deleteChild()
158  * Override this to delete association objects if necessary
159  */
160  function deleteChild($childOID, $reallyDelete=false)
161  {
162  // do default
163  parent::deleteChild($childOID, $reallyDelete);
164  }
165 }
166 ?>
getChildrenEx($oid, $type, $values, $properties)
get($message, $parameters=null, $domain='', $lang='')
Node is the basic component for building trees (although a Node can have one than more parents)...
Definition: class.Node.php:118
getValue($name, $type=null)
getValueDisplayName($name, $type=null)
setFkUserId($fk_user_id)
loadChildren($type, $buildDepth=BUILDDEPTH_SINGLE, $forceUpdate=false)
getParentsEx($oid, $type, $values, $properties, $useRegExp=true)
Definition: class.Node.php:618
const DATATYPE_IGNORE
addChild(&$child, $addtype=ADDCHILD_BACK)
const ADDCHILD_BACK
Definition: class.Node.php:31
NMUserRoleBase($oid=null, $type=null)
setValue($name, $value, $type=null, $forceSet=false)
setFkRoleId($fk_role_id)
getFkRoleId($unconverted=false)
const BUILDDEPTH_SINGLE
getUnconvertedValue($name, $type=null)
deleteChild($childOID, $reallyDelete=false)
getFkUserId($unconverted=false)
getValueDescription($name, $type=null)