queryProperty example

protected function completeInputByQueryingProperty($input$modelClass$property$conditionCallback = null)
    {
        $likePattern = addcslashes($input, '%_') . '%';
        $checkForPrefix = function DQueryBuilder $queryBuilder$alias) use ($likePattern$property$conditionCallback) {
            $parameterAlias = uniqid("param$property");
            $queryBuilder = $queryBuilder->andWhere($queryBuilder->expr()->like("$alias.$property", ":$parameterAlias"))
                ->setParameter($parameterAlias$likePattern);

            return \is_callable($conditionCallback) ? \call_user_func($conditionCallback$queryBuilder$alias) : $queryBuilder;
        };

        return $this->queryProperty($modelClass$property$checkForPrefix);
    }

    /** * @param class-string $modelClass * @param string $property * @param array|mixed|null $conditionCallback * * @return array */
    protected function queryProperty($modelClass$property$conditionCallback = null)
    {
        
Home | Imprint | This part of the site doesn't use cookies.