Add an \sb\ICalendar\Event request

@param \sb\ICalendar\Event $event
189215
public function addIcalendarEvent(\sb\ICalendar\Event $event)
    {

        $a = new \sb\Email\Attachment();
        $a->mime_type = 'text/calendar;';
        $a->setEncoding('8bit');
        $a->name = 'event.ics';
        $a->contents = $event->__toString();

        $this->addAttachment($a);
    }
582216
public function onRequestBeforeSend(Event $event)
    {
        $timestamp = $this->getTimestamp($event);
        $request = $event['request'];
        $nonce = $this->generateNonce($request);
        $authorizationParams = $this->getOauthParams($timestamp, $nonce);
        $authorizationParams['oauth_signature']  = $this->getSignature($request, $timestamp, $nonce);

        switch ($this->config['request_method']) {
            case self::REQUEST_METHOD_HEADER:
                $request->setHeader(
                    'Authorization',
                    $this->buildAuthorizationHeader($authorizationParams)
                );
                break;
            case self::REQUEST_METHOD_QUERY:
                foreach ($authorizationParams as $key => $value) {
                    $request->getQuery()->set($key, $value);
                }
                break;
            default:
                throw new \InvalidArgumentException(sprintf(
                    'Invalid consumer method "%s"',
                    $this->config['request_method']
                ));
        }

        return $authorizationParams;
    }
322408
public function onRequestBeforeSend(Event $event) {
        if ($this->token != null) {
            $event['request']->setHeader('x-cos-security-token', $this->token);
        }
/*
        if(!$this->credentials instanceof NullCredentials) {
            $this->signature->signRequest($event['request'], $this->credentials);
        }
*/
    }
806351
public function buildFromEvent(Event $event)
    {
        $this->setEvent($event);

        $configs = $this->getConfigFilesByComposer();
        $this->addFindersByConfigs($configs);

        // We have to initialize composer autoload
        require_once 'vendor/autoload.php';

        $this->build();
    }
1248461
public function addEvent($event, $eventParams)
    {
        // check if valid rule usage for object_type_id
        $this->validateRule("Events", $event);
        // get required parameters for specific rule
        $requiredParams = Events::GetRequiredParams($event);
        // checking for missing and invalid types for each parameter
        $check_params = $this->_checkParams($requiredParams, $eventParams);
        // if no missing or invalid rule parameters
        if ($check_params)
        {
            $value = $this->_formatParams($eventParams);
            $rule = $event . "(" . $value . ")";
            $this->_events[] = $rule;

            return $this->_events;
        }
        return false;
    }
190132
public function add_listener($event) {
		if (strpos('::', $event) === false) {
			$classname = get_called_class();
			$method = $event;
		} else {
			list($classname, $method) = explode('::', $event);
		}
		$event_name = strtolower(str_replace('\\', '_', $classname . '_' . $method));

		$dispatcher = \Skeleton\Event\Dispatcher::get();
		$dispatcher->add_listener($event_name, [ '\\Event\\' . $classname, $method ]);
	}
692222
public function add(EventInterface $event)
    {
        $index = $this->computeIndex($event);
        if (isset($this->events[$index])) {
            $this->events[$index][] = $event;
        } else {
            $this->events[$index] = array($event);
        }

        ++$this->count;
    }
1082943
public function publish(Event $event)
    {
        foreach ($this->locator->listenersOfEvent($event) as $listener) {
            call_user_func($listener, $event);
        }
    }
1309332
public function addEvent(Event $event)
    {
        $expectedSequenceNumber = $this->nextSequenceNumber();
        if ($expectedSequenceNumber !== $event->sequenceNumber()) {
            throw new \RuntimeException('Corrupted sequence number.');
        }

        $this->events[] = $this->applyRegistrationCallbacks($event);
    }
1050611
public function onRequestBeforeSend(Event $event)
    {
        if (!strlen($this->config['access_token'])) {
          return;
        }

        switch ($this->config['authorize_location']) {
          case 'query':
            $event['request']->getQuery()->set(
              $this->config['query_param_key'],
              $this->config['access_token']
            );
            break;

          default:
            $authorizationParams = array(
                'access_token'     => $this->config['access_token'],
                'token_type'       => $this->config['token_type'],
            );

            $event['request']->setHeader(
                'Authorization',
                $this->buildAuthorizationHeader($authorizationParams)
            );
            break;
        }
    }
1305733
private function addEvent($event)
    {
        if (is_string($event)) {
            $event = Event::named($event);
        }

        if (!$event instanceof EventInterface) {
            throw new \InvalidArgumentException(
                'Events should be provides as Event instances or string, received type: ' . gettype($event)
            );
        }

        $this->events[] = $event;

        return $event;
    }
1340925
public function dispatch(Event $event) {

		$this->lastEvent = $event;
		$eventName = $event->getName();

		if (isset($this->registry[$eventName])) {

			foreach ($this->getSortedRegistry($eventName) as $listener) {
				call_user_func($listener, $event);
			}
			
		}

	}
146960
protected function handleEvent($event)
    {
        if (!is_null($response = $this->call('event.*', array($event)))) {
            return $response;
        }

        $event['Event'] = strtolower($event['Event']);

        return $this->call("event.{$event['Event']}", array($event));
    }
983060
public function pushRequest(TaskEvent $event)
    {
        $task = $this->taskRepository->findByTaskId($event->getTask()->getUuid());
        if (!$task) {
            // current task is not managed by this bundle

            return;
        }

        $request = new Request(
            [],
            [],
            ['_task_id' => $event->getTask()->getUuid()],
            [],
            [],
            ['SERVER_NAME' => $task->getHost(), 'HTTPS' => $task->getScheme() === 'http' ? 'off' : 'on']
        );

        $this->requestStack->push($request);
    }
117044
public function addPublicKey(Event $event) {
        $command = $event['command'];
        $request = $command->getRequest();
        $url = $request->getUrl(true);

        // Don't add public key if query string already contains public key
        if ($url->getQuery()->hasKey('publicKey')) {
            return;
        }

        $client = $request->getClient();
        $publicKey = $client->getPublicKey();
        $user = $client->getUser();

        // No need for the header if the user and public key matches
        if ($user && $user === $publicKey) {
            return;
        }

        $request->setHeader('X-Imbo-PublicKey', $publicKey);
    }
235058
public function event( $event ) 
	{
		// call the wake event
		if ( is_string( $this->namespace ) ) 
		{
			if ( strpos( $event, '::' ) !== false ) 
			{
				$callback = explode( '::', $event );
				$class = $this->namespace."\\".$callback[0];
				
				if ( class_exists( $class ) ) 
				{
					call_user_func( array( $this, $callback[1] ) );
				}
			} 
			else 
			{
				if ( is_file( $this->path.$event ) ) 
				{
					require $this->path.$event;
				}
			}
		} 
		else
		{
			if ( is_file( $this->path.$event ) )
			{
				require $this->path.$event;
			}
		}
	}
1304994
public function onRequestCreate(Event $event)
    {
        $client = $event['client'];
        $token = $client->getToken();
        
        $event['request']->setHeader('X-Auth-Token', $token);
    }