70 array(
'invalidOids' => array($request->getValue(
'sourceOid')))));
76 array(
'invalidOids' => array($request->getValue(
'targetOid')))));
82 $mapper = $persistenceFacade->getMapper($sourceOid->getType());
84 if ($request->hasValue(
'role')) {
85 $relationDesc = $mapper->getRelation($request->getValue(
'role'));
86 if ($relationDesc == null) {
93 $relationDesc = $mapper->getRelation($targetOid->getType());
94 if ($relationDesc == null) {
110 $transaction = $persistenceFacade->getTransaction();
111 $transaction->begin();
123 if ($request->hasValue(
'role')) {
124 $role = $request->getValue(
'role');
127 if ($sourceNode != null && $targetNode != null) {
129 if ($request->getAction() ==
'associate') {
131 $sourceNode->addNode($targetNode, $role);
138 elseif ($request->getAction() ==
'disassociate') {
140 $sourceNode->deleteNode($targetNode, $role);
149 if ($sourceNode == null) {
151 array(
'invalidOids' => array(
'sourceOid'))));
153 if ($targetNode == null) {
155 array(
'invalidOids' => array(
'targetOid'))));
158 $transaction->commit();
163 $transaction->rollback();
166 $response->setAction(
'ok');
getRequest()
Get the Request instance.
Controller is the base class of all controllers.
static fromException(\Exception $ex)
Factory method for transforming an exception into an ApplicationError instance.
static parse($oid)
Parse a serialized object id string into an ObjectId instance.
static get($code, $data=null)
Factory method for retrieving a predefind error instance.
ApplicationException signals a general application exception.
getLogger()
Get the Logger instance.
AssociateController is used to (dis-)associates Node instances, e.g.
getResponse()
Get the Response instance.
getPersistenceFacade()
Get the PersistenceFacade instance.