Return true if the source is an instance of \Illuminate\Database\Query\Builder

@return bool
771189
public function isSourceQueryBuilder()
    {
        return is_object($this->getSource()) && get_class($this->getSource()) == \Illuminate\Database\Query\Builder::class;
    }
164728
public function query() : Builder
	{
		if (trim($brand = $this->brand) !== '') {
			$this->builder->where('brand', 'LIKE', $brand);
		}

		return $this->builder;
	}
1229904
public function compileExists(Builder $query)
    {
        $q          = clone $query;
        $q->columns = [];
        $q->selectRaw('1 as "exists"')
          ->whereRaw('rownum = 1');

        return $this->compileSelect($q);
    }
878020
public function isTerminalType()
    {
        if(!$this->hasValidResource()) {
            return false;
        }

        if (function_exists('stream_isatty')) {
            /** @noinspection PhpVoidFunctionResultUsedInspection */
            return (bool)stream_isatty($this->resource);
        }

        return false;
    }
655552
public function create()
	{
		$db = \App::get('db');

		if (empty($db))
		{
			return false;
		}

		if (is_numeric($this->id))
		{
			$query = "INSERT INTO `#__trac_project` (id,name) VALUES ( " . $db->quote($this->id) . "," . $db->quote($this->name) . ");";
			$db->setQuery($query);

			$result = $db->query();

			if ($result !== false || $db->getErrorNum() == 1062)
			{
				return true;
			}
		}
		else
		{
			$query = "INSERT INTO `#__trac_project` (name) VALUES ( " . $db->quote($this->name) . ");";

			$db->setQuery($query);

			$result = $db->query();

			if ($result === false && $db->getErrorNum() == 1062)
			{
				$query = "SELECT id FROM `#__trac_project` WHERE name=" . $db->quote($this->name) . ";";

				$db->setQuery($query);

				$result = $db->loadResult();

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

				$this->id = $result;
				return true;
			}
			else if ($result !== false)
			{
				$this->id = $db->insertid();
				return true;
			}
		}

		return false;
	}
311761
public function newQuery()
    {
        $builder = $this->newElicitBuilder(
            $this->newBaseQueryBuilder()
        );

        // Once we have the query builders, we will set the model instances so the
        // builder can easily access any information it may need from the model
        // while it is constructing and executing various queries against it.
        $builder->setModel($this);

        return $builder;
    }
628265
protected function canBuild()
    {
        if (!empty($this->requiredParams)) {
            $this->builder->build($this->requiredParams, $this->params);

            if ($this->builder->getErrors()) {
                return false;
            }
            return $this->builder->getParams();
        }
        return true;
    }
871694
public static function isWeb()
    {
        return self::isApache() || self::isIIS() || self::isCgi() || self::isBuiltInWebServer() || self::isHHVM();
    }
842178
public function create () : bool
	{
        $dbObject 	= Database::getInstance();
		$attributes = $this->sanitizedAttributes();
		$sqlQuery	= "INSERT INTO ".static::$tableName." (";
		$sqlQuery  .= join(", ", array_keys($attributes));
	  	$sqlQuery  .= ") VALUES ('";
		$sqlQuery  .= join("', '", array_values($attributes));
		$sqlQuery  .= "')";
		$result 	= $dbObject->query($sqlQuery);
    	$this->id 	= $dbObject->insertId();
    	return ($result) ? TRUE : FALSE;
	}
763828
public function exists() : bool
    {
        $query = static::createQuery();
        $pks = static::getPrimaryKeys();
        $pkValues = $this->getPrimaryKeyValues();

        if (count($pks) != count($pkValues)) {
            return false;
        }

        $filterFunction = function (WhereClause $whereClause) use (&$pkValues, $query) {
            foreach ($pkValues as $field => $value) {
                $whereClause->and($field, '=', '?');
                $query->bind($value);
            }
        };
        $query->where($filterFunction)
            ->count('*');

        $row = $query->execute()->fetch();

        return $row['all_count'] > 0;
    }
40078
public function build()
    {
        /**
         * Query to be returned.
         *
         * @var string
         */
        $query = '';

        /**
         * Clauses which were built already.
         *
         * It is required to keep track of built clauses because some fields,
         * for example `join` is used by multiple clauses (`JOIN`, `LEFT JOIN`,
         * `LEFT OUTER JOIN`, etc.). The same happens for `VALUE` and `VALUES`.
         *
         * A clause is considered built just after fields' value
         * (`$this->field`) was used in building.
         *
         * @var array
         */
        $built = [];

        /**
         * Statement's clauses.
         *
         * @var array
         */
        $clauses = $this->getClauses();

        foreach ($clauses as $clause) {
            /**
             * The name of the clause.
             *
             * @var string
             */
            $name = $clause[0];

            /**
             * The type of the clause.
             *
             * @see self::$CLAUSES
             *
             * @var int
             */
            $type = $clause[1];

            /**
             * The builder (parser) of this clause.
             *
             * @var Component
             */
            $class = Parser::$KEYWORD_PARSERS[$name]['class'];

            /**
             * The name of the field that is used as source for the builder.
             * Same field is used to store the result of parsing.
             *
             * @var string
             */
            $field = Parser::$KEYWORD_PARSERS[$name]['field'];

            // The field is empty, there is nothing to be built.
            if (empty($this->$field)) {
                continue;
            }

            // Checking if this field was already built.
            if ($type & 1) {
                if (! empty($built[$field])) {
                    continue;
                }
                $built[$field] = true;
            }

            // Checking if the name of the clause should be added.
            if ($type & 2) {
                $query = trim($query) . ' ' . $name;
            }

            // Checking if the result of the builder should be added.
            if ($type & 1) {
                $query = trim($query) . ' ' . $class::build($this->$field);
            }
        }

        return $query;
    }
839845
public function isAdminHome(): bool
    {
        return $this->url->current() == $this->url->to($this->config->get('helpers.paths.admin'));
    }
719637
public function getQueryBuilder()
    {
        if (null === $this->queryBuilder) {
            $builder = QueryBuilderFactory::getQueryBuilder($this->getConnection());
            $this->setTableAlias($builder, $this->getModel()->tableName());
            $builder->setAlias($this->getTableAlias());
            $model = $this->getModel();
            $meta = $model->getMeta();
            $builder->table($model->tableName());

            $fetchColumnCallback = new FetchColumnCallback($model, $meta);
            $callback = new LookupCallback($model);
            $joinCallback = new JoinCallback($model);
            $builder
                ->getLookupBuilder()
                ->setFetchColumnCallback($fetchColumnCallback)
                ->setCallback($callback)
                ->setJoinCallback($joinCallback);
            $this->queryBuilder = $builder;
        }

        return $this->queryBuilder;
    }
1301758
protected function newBaseQueryBuilder()
    {
        $conn    = $this->getConnection();
        $grammar = $conn->getQueryGrammar();

        if ($grammar instanceof OracleGrammar) {
            return new QueryBuilder($conn, $grammar, $conn->getPostProcessor());
        }

        return new IlluminateQueryBuilder($conn, $grammar, $conn->getPostProcessor());
    }
56184
protected function isQueryAttribute()
    {
        if( $query = ($this->settings['query'] ?? NULL) )
        {
            $this->settings['getrow'] = Singleton::class('ZN\Database\DB')->query($query)->row();
        }
    }
808140
protected function newBaseQueryBuilder()
    {
        $conn = $this->getConnection();

        $grammar = $conn->getQueryGrammar();

        $builder = new Builder($conn, $grammar, $conn->getPostProcessor());

        if (isset($this->rememberFor)) {
            $builder->remember($this->rememberFor);
        }

        if (isset($this->rememberCacheTag)) {
            $builder->cacheTags($this->rememberCacheTag);
        }

        if (isset($this->rememberCachePrefix)) {
            $builder->prefix($this->rememberCachePrefix);
        }

        if (isset($this->rememberCacheDriver)) {
            $builder->cacheDriver($this->rememberCacheDriver);
        }

        return $builder;
    }
750799
protected function getBaseQueryBuilder($instance = null)
    {
        if (! $instance) {
            $instance = $this->query;
        }

        if ($instance instanceof EloquentBuilder) {
            return $instance->getQuery();
        }

        return $instance;
    }