Determine if the given trigger exists.

@param  string  $trigger
@return bool
978544
public function hasTrigger($trigger)
    {
        return count($this->connection->select(
            $this->grammar->compileTriggerExists(),
            [$trigger]
        )) > 0;
    }
384241
public function exists(\Closure $closure): bool
    {
        // init
        $isExists = false;

        foreach ($this->getGenerator() as $key => $value) {
            if ($closure($value, $key)) {
                $isExists = true;

                break;
            }
        }

        return $isExists;
    }
121028
public function exists()
    {
        try {
            $this->connection->getDataset($this->identity + ['fields' => 'datasetReference']);
        } catch (NotFoundException $ex) {
            return false;
        }

        return true;
    }
215793
public function exists($document)
    {
        $identifier = $this->class->createIdentifier($document);
        $qb         = $this->dm->createQueryBuilder($this->class->name);
        $query      = $qb->get()->setIdentifier($identifier)->getQuery();

        return (boolean)$query->getSingleMarshalledResult();
    }
168210
public function exists($condition='', $params=null) {
		$cnt = $this->driver
            ->field('count(*)')
            ->where($condition, $params)
            ->fetchColumn();
		return $cnt > 0 ? true : false;
	}
192878
public function exists(Event $event)
    {
        return $this->cache->store($this->store)->has($event->mutexName());
    }
1127307
public static function triggers($triggers = null)
    {
        if (is_object($triggers)) {
            self::$triggers = new Triggers($triggers);
        }

        return isset(self::$triggers) ? self::$triggers : self::$triggers = new Triggers;
    }
250079
public function releaseTrigger ($trigger) {
		if ($this->request->data) {
			Request::RemovePostData($trigger);
			if (Arrays::KeyExists($this->request->data, $trigger)) {
				unset($this->request->data->$trigger);
			}
		}

		if ($this->request->parameter) {
			Request::RemoveParameter($trigger);
			if (Arrays::KeyExists($this->request->parameter, $trigger)) {
				unset($this->request->parameter->$trigger);
			}
		}

		$this->trigger = null;
	}
1164188
public function exists(string $url = null): bool
	{
		$urls = $this->getPageList();
		if (isset($urls[$url])) {
			return true;
		} else {
			return false;
		}
	}
1114956
public function table_exists($table) {
        if (is_string($table)) {
            $tablename = $table;
        } else {
            // Calculate the name of the table
            $tablename = $table->getName();
        }

        if ($this->temptables->is_temptable($tablename)) {
            return true;
        }

        // Get all tables in moodle database.
        $tables = $this->mdb->get_tables();
        return isset($tables[$tablename]);
    }
444045
public function hasTable($table)
    {
        $sql = $this->grammar->compileTableExists();

        $table = $this->connection->getTablePrefix().$table;

        return count($this->connection->select($sql, array($table))) > 0;
    }
223675
public function setExitTrigger($trigger)
    {
        $validTriggers = [
            'die',
            'exception'
        ];
        if (!in_array($trigger, $validTriggers)) {
            throw new OAuth2Exception(('Invalid exit trigger "' . $trigger . '".'));
        }

        $this->exitTrigger = $trigger;
    }
617748
public function exists($statement, array $bindings = [])
    {
        $sql = sprintf('SELECT EXISTS(%s) AS `exists`', $statement);

        $result = $this->fetchObject($sql, $bindings);

        return $result ? $result->exists : 0;
    }
1308059
public function trigger($event)
    {
        $result = false;
        if (isset(self::$event[$event])) {
            $result = call_user_func_array(self::$event[$event], [$this]);
        }

        return $result;
    }
386076
public static function table_exists($table, $db = null)
	{
		try
		{
			\DB::select()->from($table)->limit(1)->execute($db ? $db : static::$connection);
			return true;
		}
		catch (\Database_Exception $e)
		{
			// check if we have a DB connection at all
			$connection = \Database_Connection::instance($db ? $db : static::$connection)->has_connection();

			// if no connection could be made, re throw the exception
			if ( ! $connection)
			{
				throw $e;
			}

			return false;
		}
	}
930190
protected function determineWordCount($triggers)
    {
        $triggers = $triggers->each(function ($data, $trigger) use ($triggers) {
            $data['order'] = count(explode(' ', $trigger));

            $triggers->put($trigger, $data);
        });

        return $triggers;
    }
1138854
public function exists()
	{
		$sql = $this->grammar->compileExists( $this );

		$results = $this->connection->select( $sql, $this->getBindings(), !$this->useWritePdo );

		if ( isset( $results[0] ) )
		{
			$results = (array) $results[0];

			return (bool) $results['exists'];
		}

		return false;
	}