Skip to Content.
Sympa Menu

comanage-dev - [comanage-dev] r273 - registry/trunk/app/Controller

Subject: COmanage Developers List

List archive

[comanage-dev] r273 - registry/trunk/app/Controller


Chronological Thread 
  • From:
  • To:
  • Subject: [comanage-dev] r273 - registry/trunk/app/Controller
  • Date: Mon, 2 Apr 2012 10:45:46 -0400

Author: benno
Date: 2012-04-02 10:45:46 -0400 (Mon, 02 Apr 2012)
New Revision: 273

Modified:
registry/trunk/app/Controller/StandardController.php
Log:
Initial support for view_contains (CO-195)

Modified: registry/trunk/app/Controller/StandardController.php
===================================================================
--- registry/trunk/app/Controller/StandardController.php 2012-03-30
00:18:36 UTC (rev 272)
+++ registry/trunk/app/Controller/StandardController.php 2012-04-02
14:45:46 UTC (rev 273)
@@ -684,13 +684,27 @@
$req = $this->modelClass;
$model = $this->$req;
$modelpl = Inflector::tableize($req);
-
- if(isset($this->view_recursion))
- $model->recursive = $this->view_recursion;
-
+
$model->id = $id;
- $obj = $model->read();

+ if(isset($this->view_contains)) {
+ // New style: use containable behavior
+
+ $args = array();
+
+ $args['conditions'][$req.'.id'] = $id;
+ $args['contain'] = $this->view_contains;
+
+ $obj = $model->find('first', $args);
+ } else {
+ // Old style: use recursion (if set)
+
+ if(isset($this->view_recursion))
+ $model->recursive = $this->view_recursion;
+
+ $obj = $model->read();
+ }
+
if(empty($obj))
{
if($this->restful)



  • [comanage-dev] r273 - registry/trunk/app/Controller, svnlog, 04/02/2012

Archive powered by MHonArc 2.6.16.

Top of Page