Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
RAssignmentDataProvider.php
1 <?php
2 
3 class RAssignmentDataProvider extends CActiveDataProvider {
4 
5  /**
6  * @property RAuthorizer
7  */
8  private $_authorizer;
9 
10  /**
11  * Constructor.
12  * (e.g. <code>Post::model()</code>, <code>Post::model()->published()</code>).
13  *
14  * @param array $config configuration (name=>value) to be applied as the initial property values of this class.
15  */
16  public function __construct($config = array())
17  {
18  $module = Rights::module();
19  $userClass = $module->userClass;
20  parent::__construct($userClass, $config);
21 
22  $this->_authorizer = $module->getAuthorizer();
23  }
24 
25  /**
26  * Fetches the data from the persistent data storage.
27  *
28  * @return array list of data items
29  */
30  protected function fetchData()
31  {
32  $data = parent::fetchData();
33 
34  foreach ($data as $model) {
35  $this->_authorizer->attachUserBehavior($model);
36  }
37 
38  return $data;
39  }
40 }