@param array $properties
@param string|null $calendarId

@return mixed
198902
public static function create(array $properties, string $calendarId = null, $optParams = [])
    {
        $event = new static;

        $event->calendarId = static::getGoogleCalendar($calendarId)->getCalendarId();

        foreach ($properties as $name => $value) {
            $event->$name = $value;
        }

        return $event->save('insertEvent', $optParams);
    }
274504
public function createEntityEvent($event, $entityType, $entityId, array $properties = [], DateTime $eventTime = null)
    {
        $event = new EntityEvent($event, $entityType, $entityId);
        $event->setProperties($properties);
        $event->setEventTime($eventTime);
        $response = $this->createEvent($event->toArray());

        return $response;
    }
273094
public function clearCalendar($calendarID)
	{
		if ($this->isAuthenticated())
		{
			$data = $this->query('https://www.googleapis.com/calendar/v3/users/me/calendars/' . urlencode($calendarID) . '/clear', null, null, 'post');

			if ($data->body != '')
			{
				throw new UnexpectedValueException("Unexpected data received from Google: `{$data->body}`.");
			}

			return true;
		}
		else
		{
			return false;
		}
	}
1094629
public function deleteEvent($calendarID, $eventID)
	{
		if ($this->isAuthenticated())
		{
			$url = 'https://www.googleapis.com/calendar/v3/users/me/calendars/' . urlencode($calendarID) . '/events/' . urlencode($eventID);
			$data = $this->query($url, null, null, 'delete');

			if ($data->body != '')
			{
				throw new UnexpectedValueException("Unexpected data received from Google: `{$data->body}`.");
			}

			return true;
		}
		else
		{
			return false;
		}
	}
834284
public function listAcl($calendarId, $optParams = array()) {
      $params = array('calendarId' => $calendarId);
      $params = array_merge($params, $optParams);
      $data = $this->__call('list', array($params));
      if ($this->useObjects()) {
        return new Google_Acl($data);
      } else {
        return $data;
      }
    }
780233
function get_session_by_id($sessionid) {
        try {
            $param = new \Panopto\SessionManagement\GetSessionsById($this->auth, array($sessionid));
            $sessions = $this->smclient->GetSessionsById($param)->getGetSessionsByIdResult()->getSession();
        } catch (Exception $e) {
            return false;
        }
        if (count($sessions)) {
            return $sessions[0];
        }
        return false;
    }
1008299
public function initialize(array $properties = null)
    {
        $hasOne = [];
        $hasMany = [];

        if (null !== $properties) {
            foreach ($properties as $key => $value) {
                if (true === $this->isHasOne($key)) {
                    // Load hasOne relationship.
                    $hasOne[$key] = $this->getStore()->loadProxyModel($value['type'], $value['id']);
                    continue;
                }
            }
        }

        foreach ($this->getMetadata()->getRelationships() as $key => $relMeta) {
            if (true === $relMeta->isOne()) {
                continue;
            }
            if (true === $relMeta->isInverse) {
                $hasMany[$key] = $this->getStore()->createInverseCollection($relMeta, $this);
            } else {
                $references = !isset($properties[$key]) ? [] : $properties[$key];
                $hasMany[$key] = $this->getStore()->createCollection($relMeta, $references);
            }
        }

        $this->hasOneRelationships  = (null === $this->hasOneRelationships) ? new Relationships\HasOne($hasOne) : $this->hasOneRelationships->replace($hasOne);
        $this->hasManyRelationships = (null === $this->hasManyRelationships) ? new Relationships\HasMany($hasMany) : $this->hasManyRelationships->replace($hasMany);
        return parent::initialize($properties);
    }
615286
public function delete(?string $id = null)
    {
        $this->request->allowMethod(['post', 'delete']);
        $calendar = $this->Calendars->get($id);

        if ($this->Calendars->delete($calendar)) {
            $this->Flash->success((string)__('The calendar has been deleted.'));
        } else {
            $this->Flash->error((string)__('The calendar could not be deleted. Please, try again.'));
        }

        return $this->redirect(['action' => 'index']);
    }
578968
private function _getSession($sessionId)
    {
        if (is_null($this->_session)) {
            $this->_session = $this->_repository->find(array('sessionId' => $sessionId));
        }

        return $this->_session;
    }
441865
protected function getMissingBaseProperties(array $properties = null)
    {
        $basePropertyKeys = PropertyIds::getBasePropertyKeys();

        if ($properties === null) {
            return $basePropertyKeys;
        }

        foreach ($properties as $property) {
            $propertyId = $property->getId();
            $basePropertyKey = array_search($propertyId, $basePropertyKeys);
            if ($basePropertyKey !== false) {
                unset($basePropertyKeys[$basePropertyKey]);
            }
        }

        return $basePropertyKeys;
    }
1083717
public function deleteCalendarObject($calendarId, $objectUri)
    {
        $stmt = $this->pdo->prepare('DELETE FROM simple_calendarobjects WHERE calendarid = ? AND uri = ?');
        $stmt->execute([$calendarId, $objectUri]);
    }
1371769
public static function getCalendarShortMonths($calendarId = 0) {
		if(!isset(self::$calendarShortMonths[$calendarId])) {
			$calendar_info = cal_info($calendarId);
			self::$calendarShortMonths[$calendarId] = $calendar_info['abbrevmonths'];
		}		
		return self::$calendarShortMonths[$calendarId];
	}
525230
public function getCalendar($calendarID)
	{
		if ($this->isAuthenticated())
		{
			$jdata = $this->query('https://www.googleapis.com/calendar/v3/users/me/calendarList/' . urlencode($calendarID));

			if ($data = json_decode($jdata->body, true))
			{
				return $data;
			}
			else
			{
				throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`.");
			}
		}
		else
		{
			return false;
		}
	}
401648
public static function propertyKeyForId($propertyId)
    {
        if (isset(static::$identityMap[$propertyId])) {
            return static::$identityMap[$propertyId]->key;
        }
        if (isset(static::$propertyIdToKey[$propertyId])) {
            return static::$propertyIdToKey[$propertyId];
        }

        static::$propertyIdToKey[$propertyId] = Yii::$app->cache->lazy(
            function () use ($propertyId) {
                $query = new Query();
                return $query
                    ->select(['key'])
                    ->from(static::tableName())
                    ->where(['id' => $propertyId])
                    ->scalar(static::getDb());
            },
            "PropertyKeyForId:$propertyId",
            86400
        );
        return static::$propertyIdToKey[$propertyId];
    }
606120
public function getProperty($id)
    {
        if (!isset($this->properties[$id])) {
            return null;
        }

        return $this->properties[$id];
    }
1023714
public static function calendar(Calendar $calendar)
    {
        $offerCalenderUpdate = function ($body) use ($calendar) {
            // Purge any existing calendar data
            unset(
                $body->calendarType,
                $body->startDate,
                $body->endDate,
                $body->subEvent,
                $body->openingHours
            );

            return (object) array_merge(
                (array) $body,
                $calendar->toJsonLd()
            );
        };

        return $offerCalenderUpdate;
    }
994154
public function import($calendarId, Google_Event $postBody, $optParams = array()) {
      $params = array('calendarId' => $calendarId, 'postBody' => $postBody);
      $params = array_merge($params, $optParams);
      $data = $this->__call('import', array($params));
      if ($this->useObjects()) {
        return new Google_Event($data);
      } else {
        return $data;
      }
    }