EVENT_TYPE::getScriptingEventsWithScope PHP Method

getScriptingEventsWithScope() public static method

public static getScriptingEventsWithScope ( )
    public static function getScriptingEventsWithScope()
    {
        $events = [];
        foreach (self::getScriptingEvents() as $k => $v) {
            $events[$k] = ['name' => $k, 'description' => $v, 'scope' => 'scalr'];
        }
        return $events;
    }

Usage Example

Example #1
0
 private function getEventsList()
 {
     $events = EVENT_TYPE::getScriptingEventsWithScope();
     $envId = null;
     if ($this->request->getScope() == WebhookConfig::SCOPE_ENVIRONMENT) {
         $envId = (int) $this->getEnvironmentId(true);
     }
     //Temporary added new events like this, workign on events refactoring
     $events['HostInitFailed'] = ['name' => 'HostInitFailed', 'description' => 'Instance was unable to initialize', 'scope' => 'scalr'];
     $events['InstanceLaunchFailed'] = ['name' => 'InstanceLaunchFailed', 'description' => 'Scalr failed to launch instance due to cloud error', 'scope' => 'scalr'];
     $events = array_merge($events, \Scalr\Model\Entity\EventDefinition::getList($this->user->getAccountId(), $envId));
     return $events;
 }
All Usage Examples Of EVENT_TYPE::getScriptingEventsWithScope