<?php

/**
 *   $group->primaryKey
 *   $group->realName		realName eg. "[123] Grupa 123"
 *   $group->nestedGroups
 *   $group->type			'STANOWISKO','PODMIOT','DZIAL','local','network'
 *   (optional) $group->zasobID
 *   (optional) $group->zasobDESC
 */
class ObjectGroup {

	public $primaryKey;
	public $realName;
	public $type;// 'STANOWISKO','PODMIOT','DZIAL','local','network'
	//     'local' - access groups like com.apple.access_mail
	//     'network' - network group: workgroup
	public $nestedGroups;
	public $parentGroups = null;
	public $zasobID;// (optional)
	public $zasobDESC;// (optional)

	protected $_storage;

	public function __construct($storage) {
		$this->_storage = $storage;
	}

	public function getParentGroups() {
		if (null === $this->parentGroups) {
			$this->parentGroups = $this->_storage->getParentGroups($this);
		}
		return $this->parentGroups;
	}

}
