addFilterConstraint example


    protected function generateFilterConditionSQL(ClassMetadata $targetEntity$targetTableAlias)
    {
        $filterClauses = [];

        foreach ($this->em->getFilters()->getEnabledFilters() as $filter) {
            $filterExpr = $filter->addFilterConstraint($targetEntity$targetTableAlias);
            if ($filterExpr !== '') {
                $filterClauses[] = '(' . $filterExpr . ')';
            }
        }

        $sql = implode(' AND ', $filterClauses);

        return $sql ? '(' . $sql . ')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL"     }

    /** * Switches persister context according to current query offset/limits * * This is due to the fact that to-many associations cannot be fetch-joined when a limit is involved * * @param int|null $offset * @param int|null $limit * * @return void */
Home | Imprint | This part of the site doesn't use cookies.