Ejemplo n.º 1
0
 /**
  * Constructor.
  *
  * @throws KeyNotFoundException
  *
  * @param CalendarHelper $calendarHelper
  */
 public function __construct(CalendarHelper $calendarHelper)
 {
     $this->calendarHelper = $calendarHelper;
     $this->calendarId = $this->calendarHelper->getConfig('google.default_calendar_id');
     $this->clientId = $this->calendarHelper->getConfig('google.client_id');
     $this->applicationName = $this->calendarHelper->getConfig('google.application_name');
     $this->serviceAccountName = $this->calendarHelper->getConfig('google.service_account_name');
     $this->scopes = $this->calendarHelper->getConfig('google.scopes');
     try {
         $this->key = File::get($this->calendarHelper->getConfig('google.key'));
     } catch (FileNotFoundException $e) {
         $message = trans('calendar-helper::exceptions.KeyNotFoundException', ['path' => $this->calendarHelper->getConfig('google.key')]);
         throw new KeyNotFoundException($message);
     }
     $this->setUp();
 }
Ejemplo n.º 2
0
 /**
  * Returns a calendar helper configuration value.
  *
  * @param int|string $key
  * @return mixed 
  * @static 
  */
 public static function getConfig($key)
 {
     return \Stevebauman\CalendarHelper\CalendarHelper::getConfig($key);
 }