src/Storage/SelectQuery.php
/**
     * Part of the QueryInterface this turns all the input into a Doctrine
     * QueryBuilder object and is usually run just before query execution.
     * That allows modifications to be made to any of the parameters up until
     * query execution time.
     */
Part of the QueryInterface this turns all the input into a Doctrine
QueryBuilder object and is usually run just before query execution.
That allows modifications to be made to any of the parameters up until
query execution time.
Part of the QueryInterface this turns all the input into a Doctrine QueryBuilder object and is usually run just before query execution . That allows modifications to be made to any of the parameters up until query execution time .
public function build(): QueryBuilder
    {
        $query = $this->qb;
        $dateFields = $this->getDateFields();
        $numberFields = $this->getNumberFields();
        $this->setRegularFields();
        $whereExpression = $this->getWhereExpression();
        if ($whereExpression) {
            $query->andWhere($whereExpression);
        }
        foreach ($this->getWhereParameters() as $key => $param) {
            $fieldName = preg_replace('/(_[0-9]+)$/', '', $key);
            if (in_array($fieldName, $dateFields, true) && (strtotime($param) !== false)) {
                $param = date('Y-m-d h:i', strtotime($param));
            }
            if (in_array($fieldName, $this->regularFields, true) && ! in_array($fieldName, $numberFields, true)) {
                $param = JsonHelper::wrapJsonFunction(null, $param, $query->getEntityManager()->getConnection());
            }
            $query->setParameter($key, $param, ParameterTypeInferer::inferType($param));
        }
        return $query;
    }
public function build ( ) : QueryBuilder { $ query = $ this -> qb ; $ dateFields = $ this -> getDateFields ( ) ; $ numberFields = $ this -> getNumberFields ( ) ; $ this -> setRegularFields ( ) ; $ whereExpression = $ this -> getWhereExpression ( ) ; if ( $ whereExpression ) { $ query -> andWhere ( $ whereExpression ) ; } foreach ( $ this -> getWhereParameters ( ) as $ key => $ param ) { $ fieldName = preg_replace ( '/(_[0-9]+)$/' , '' , $ key ) ; if ( in_array ( $ fieldName , $ dateFields , true ) && ( strtotime ( $ param ) !== false ) ) { $ param = date ( 'Y-m-d h:i' , strtotime ( $ param ) ) ; } if ( in_array ( $ fieldName , $ this -> regularFields , true ) && ! in_array ( $ fieldName , $ numberFields , true ) ) { $ param = JsonHelper :: wrapJsonFunction ( null , $ param , $ query -> getEntityManager ( ) -> getConnection ( ) ) ; } $ query -> setParameter ( $ key , $ param , ParameterTypeInferer :: inferType ( $ param ) ) ; } return $ query ; }
Part of the QueryInterface this turns all the input into a Doctrine
 QueryBuilder object and is usually run just before query execution.
Part of the QueryInterface this turns all the input into a Doctrine QueryBuilder object and is usually run just before query execution .
// Set the regular fields. They are needed for setting the correct param if DB does not support json. // Use strtotime on 'date' fields to allow selections like "today", "in 3 weeks" or "this year"