Check if trigger exists.

@param  string $trigger_name
@return bool
13627
private function triggerExists($trigger_name)
    {
        if ($triggers = $this->getConnection()->execute('SHOW TRIGGERS', $trigger_name)) {
            foreach ($triggers as $trigger) {
                if ($trigger['Trigger'] == $trigger_name) {
                    return true;
                }
            }
        }

        return false;
    }
824952
public function getTriggerById($trigger_id) {
        $data = [ ];
        $data['trigger_id'] = $trigger_id;

        $result = $this->apiGet('trigger', $data);
        return $result;
    }
145828
public function delete($trigger_id)
    {
        $result = null;
        $this->hook->attach('trigger.delete.before', $trigger_id, $result, $this);

        if (isset($result)) {
            return (bool) $result;
        }

        $result = (bool) $this->db->delete('triggers', array('trigger_id' => $trigger_id));
        $this->hook->attach('trigger.delete.after', $trigger_id, $result, $this);
        return (bool) $result;
    }
251782
@SuppressWarnings("squid:S1698")
    public boolean wasTriggeredBy(String... triggers) {
        if (triggers.length == 0) {
            return false;
        }
        for (String aTrigger : triggers) {
            if (aTrigger != null && aTrigger.intern() == getTrigger()) {
                return true;
            }
        }

        return false;
    }
361849
public static function exists($name)
	{
		if(isset(self::$modifys[$name]))
		{
			return true;
		}
		else if(array_key_exists($name,self::$modifys))
		{
			return false;
		}
		else
		{
			self::init();
			self::save();
			$names = parseCfgName($name);
			$var = $_SESSION;
			foreach($names as $name)
			{
				if('@' === $name)
				{
					$name = self::$prefix;
				}
				if('' !== $name)
				{
					$var = $var[$name];
				}
			}
			return isset($var);
		}
	}
877357
public function importsFunction($function_name = NULL) {
    if (!$this->useFunction) {
      return FALSE;
    }
    if ($function_name) {
      foreach ($this->getDeclarations() as $declaration) {
        if ($declaration->getName()->getPath() === $function_name) {
          return TRUE;
        }
      }
      return FALSE;
    }
    else {
      return TRUE;
    }
  }
1275004
public function exists($cookie_name = null)
    {
        if (!empty($cookie_name)) {
            $this->setName($cookie_name);
        }
        return isset($_COOKIE[$this->getName()]);
    }
1016958
TriggerDef getTrigger(String name) {

        for (int i = triggerList.length - 1; i >= 0; i--) {
            if (triggerList[i].name.name.equals(name)) {
                return triggerList[i];
            }
        }

        return null;
    }
346264
public function exist($name){
		$name=strtolower($name);
		return (isset($this->events[$name]) && sizeof($this->events[$name]));
	}
153935
public function has(string $name) : bool
    {
        if (Arr::keyExists($this->registry, $name)) {
            return true;
        } else {
            return false;
        }
    }
1220776
public function __isset($name) {
		// Property exists
		if (isset($this->_data[$name])) {
			return true;
		}
		
		// Init method exists
		if (method_exists($this, lcfirst($name) . self::INIT_POSTFIX)) {
			return true;
		}
		
		// Init source exists
		if (! empty($this->_sources[$name])) {
			return true;
		}
		
		return false;
	}
1216758
protected function validateTrigger()
    {
        $id = $this->getUpdatingId();

        if ($id === false) {
            return null;
        }

        $data = $this->trigger->get($id);

        if (empty($data)) {
            $this->setErrorUnavailable('update', $this->translation->text('Trigger'));
            return false;
        }

        $this->setUpdating($data);
        return true;
    }
152338
public function hasErrors($error_names = null) {
		if (empty($error_names)) {
			return !empty($this->errors['flag_error_in_fields']) || !empty($this->errors['general']['danger']);
		} else {
			if (!is_array($error_names)) {
				$error_names = [$error_names];
			}
			foreach ($error_names as $v) {
				if (!empty($this->errors['fields'][$v]['danger'])) {
					return true;
				}
			}
			return false;
		}
	}
720393
public static function isFunctionCall($function_name) {
    $function_names = func_get_args();

    return function ($node) use ($function_names) {
      if ($node instanceof FunctionCallNode) {
        return in_array($node->getName()->getText(), $function_names, TRUE);
      }
      return FALSE;
    };
  }
984500
protected function setTrigger($trigger_id)
    {
        $this->data_trigger = array();

        if (is_numeric($trigger_id)) {

            $this->data_trigger = $this->trigger->get($trigger_id);

            if (empty($this->data_trigger)) {
                $this->outputHttpStatus(404);
            }
        }
    }
528312
protected function exists($name): bool
    {
        return
            isset($this->___data___[$name]) ||
            \array_key_exists($name, $this->___data___);
    }
94482
function isAllowed( $moduleName, $functionName, $connectType )
    {
        if ( isset( $this->TriggerTypes['*'] ) )
        {
            return true;
        }
        else if ( isset( $this->TriggerTypes[$moduleName] ) )
        {
            if ( isset( $this->TriggerTypes[$moduleName][$functionName] ) )
            {
                if ( in_array( $connectType, $this->TriggerTypes[$moduleName][$functionName] ) )
                {
                    return true;
                }
            }
        }

        return false;
    }