_attributes = array(); } /** * Get the attributes for this principal. * * @param array $targets An array of target modAccess classes to load. * @param string $context The context to check within. Defaults to active context. * @param boolean $reload If true, the attributes will be reloaded and the session updated. * @return array An array of attributes on the principal */ public function getAttributes($targets = array(), $context = '', $reload = false) { $context = !empty($context) ? $context : $this->xpdo->context->get('key'); if (!is_array($targets) || empty($targets)) { $targets = explode(',', $this->xpdo->getOption('principal_targets', null, 'modAccessContext,modAccessResourceGroup,modAccessCategory,sources.modAccessMediaSource,modAccessNamespace')); array_walk($targets, 'trim'); } $this->loadAttributes($targets, $context, $reload); return $this->_attributes[$context]; } }