@param $builderClass

@return \DeasilWorks\CEF\StatementBuilder
767754
public function getStatementBuilder($builderClass = Select::class)
    {
        // @SOMEDAY check for instance of StatementBuilder

        /** @var StatementBuilder $statementBuilder */
        $statementBuilder = new $builderClass();
        $table = $this->getResultModel()->getTableName();

        $statementBuilder->setFrom($table);

        return $statementBuilder;
    }
1287685
private static function _makeBuilder()
    {
        $builder = new Builder();
        $builder->table = self::getTableName();
        $builder->order = self::getOrder();
        $builder->cls   = get_called_class();
        return $builder;
    }
1358940
public function buildForm(FormBuilderInterface $builder): FormInterface
    {
        $this->buildFilterForm($builder);
        $this->buildSortableForm($builder);

        $this->form = $builder->getForm();

        return $this->form;
    }
1081672
protected function addCreatedAt(ModelQueryBuilder $builder): ModelQueryBuilder
    {
        // `Doctrine` specifics: `setValue` works for inserts and `set` for updates
        $timestamp = $this->convertDateTimeToDbValue($builder, new DateTimeImmutable());
        $builder->setValue(CommonFields::FIELD_CREATED_AT, $builder->createNamedParameter($timestamp));

        return $builder;
    }
1281469
public static <E> JpaRepositoryConfig.Builder<E> builder(Class<E> entityClass) {
        JpaRepositoryConfig.Builder<E> builder = new JpaRepositoryConfig.Builder<>();
        builder.entityClass = entityClass;
        builder.resourceClass = entityClass;
        return builder;
    }
536352
public static function getUserAwareChoiceBuilder(FormBuilderInterface $builder, UserInterface $user = null)
    {
        return function (EntityRepository $objectRepository) use ($builder, $user) {
            return $objectRepository->createQueryBuilder('o')
                ->andWhere('o.user = :user')
                ->setParameter('user', $user ?: $builder->getAttribute('user_aware'))
            ;
        };
    }
93481
protected function initializeFromBuilder(Builder $builder)
    {
        $this->setModel($builder->getModel())
            ->setEagerLoads($builder->getEagerLoads());

        $builder->macro('getProtected', function (Builder $builder, string $property) {
            return $builder->{$property};
        });

        $this->scopes = $builder->getProtected('scopes');

        $this->localMacros = $builder->getProtected('localMacros');

        $this->onDelete = $builder->getProtected('onDelete');
    }
452993
public function compile(Builder $builder)
    {
        $ands = $builder->filters['and'];
        $ors = $builder->filters['or'];
        $raws = $builder->filters['raw'];

        $query = $this->concatenate($raws);

        $query = $this->compileWheres($ands, $query);

        $query = $this->compileOrWheres($ors, $query);

        // We need to check if the query is already nested, otherwise
        // we'll nest it here and return the result.
        if (! $builder->isNested()) {
            $total = count($ands) + count($raws);

            // Make sure we wrap the query in an 'and' if using
            // multiple filters. We also need to check if only
            // one where is used with multiple orWheres, that
            // we wrap it in an `and` query.
            if ($total > 1 || (count($ands) === 1 && count($ors) > 0)) {
                $query = $this->compileAnd($query);
            }
        }

        return $query;
    }
743496
protected function createCountBuilderFromBuilder(QueryBuilder $builder): ModelQueryBuilder
    {
        $countBuilder = $this->createBuilder($this->getModelClass());
        $countBuilder->setParameters($builder->getParameters());
        $countBuilder->select('COUNT(*)')->from('(' . $builder->getSQL() . ') AS RESULT');

        return $countBuilder;
    }
1167506
protected function addWithRejected(Builder $builder)
    {
        $builder->macro('withRejected', function (Builder $builder) {
            $this->remove($builder, $builder->getModel());

            return $builder->whereIN($this->getStatusColumn($builder),
                [Status::APPROVED, Status::REJECTED]);
        });
    }
1306717
public function applyTo(ReportBuilder $builder)
    {
        $this->basic->applyTo($builder);
        $this->report->applyTo($builder);

        return $builder;
    }
799818
protected function newBaseQueryBuilder()
    {
        $conn = $this->getConnection();

        $grammar = $conn->getQueryGrammar();

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

        if ($this->expire !== null) {
            $builder->remember($this->expire);
        }

        $builder->cacheTags($this->table);

        return $builder;
    }
614532
public function of($class, $name = 'default')
    {
        return new FactoryBuilder(
            $class, $name, $this->definitions, $this->states,
            $this->afterMaking, $this->afterCreating, $this->faker
        );
    }
1257497
public static Builder newBuilder(Class<?> loggingClass) {
    if (loggingClass == null) throw new NullPointerException("loggingClass == null");
    return new Builder(Logger.getLogger(loggingClass.getName()));
  }
272648
public function apply(Builder $builder)
    {
        $this->builder = $builder;

        // We need to select all columns from the original
        // table, since many joins can mess up the selected fields
        $this->builder->select("{$this->getTableName()}.*");

        foreach ($this->filters() as $name => $value) {
            $this->callFilterMethod($name, $value);
        }

        return $this->builder;
    }
1232140
public function query() : Builder
	{
		if (trim($conditions = $this->conditions) !== '') {
			$this->builder->where('condition', 'LIKE', $conditions);
		}

		return $this->builder;
	}
1010080
public function getClassNameFromBuilder($builder, $fqcn = false)
    {
        if ($fqcn) {
            return $builder->getFullyQualifiedClassName();
        }

        $namespace = $builder->getNamespace();
        $class = $builder->getUnqualifiedClassName();

        if (isset($this->declaredClasses[$namespace])
            && isset($this->declaredClasses[$namespace][$class])) {
            return $this->declaredClasses[$namespace][$class];
        }

        return $this->declareClassNamespace($class, $namespace, true);
    }