Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
RAuthItemParentDataProvider.php
1 <?php
2 /**
3  * Authorization item parent data provider class file.
4  *
5  * @author Christoffer Niska <cniska@live.com>
6  * @copyright Copyright &copy; 2010 Christoffer Niska
7  * @since 0.9.10
8  */
10 
11  /**
12  * Constructs the data provider.
13  *
14  * @param string $parent the data provider identifier.
15  * @param array $config configuration (name=>value) to be applied as the initial property values of this class.
16  *
17  * @return \RAuthItemParentDataProvider
18  */
19  public function __construct($parent, $config = array())
20  {
21  $this->parent = $parent;
22  $this->setId($parent->name);
23 
24  foreach ($config as $key => $value) {
25  $this->$key = $value;
26  }
27  }
28 
29  /**
30  * Fetches the data from the persistent data storage.
31  *
32  * @return array list of data items
33  */
34  public function fetchData()
35  {
36  $this->items = Rights::getAuthorizer()->getAuthItemParents($this->parent->name, $this->type, null, true);
37  return parent::fetchData();
38  }
39 }