public static function getConfig($user, $throw = true) { $config = sharing_cart_plugins::get_config('repository', $user->id); if (!is_array($config)) { if ($throw) { throw new SharingCart_RepositoryException('Repository settings was missing'); } $config = array(); } return $config; }
/** internals **/ public function __construct() { try { $this->config = sharing_cart_plugins::get_config('repository', $GLOBALS['USER']->id); } catch (Exception $e) { $this->config = array(); } if (!is_array($this->config)) { $this->config = array(); } $this->dir = $GLOBALS['CFG']->wwwroot . '/blocks/sharing_cart/plugins/repository'; }