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