Programming Language PHP

Namespace Oro\Component\DoctrineUtils\ORM

Class QueryUtil

Method/Function processParameterMappings

Total Examples 1

1 code examples of PHP Oro\Component\DoctrineUtils\ORM\QueryUtil::processParameterMappings extracted from open source projects

Was this example useful?
0
                                                    /**
     * @throws QueryException
     */
    public function processParameterMappings(Query $query): array
    {
        $paramMappings = QueryUtil::parseQuery($query)->getParameterMappings();

        $paramCount = count($query->getParameters());
        $mappingCount = count($paramMappings);
        if ($paramCount > $mappingCount) {
            throw QueryException::tooManyParameters($mappingCount, $paramCount);
        }
        if ($paramCount < $mappingCount) {
            throw QueryException::tooFewParameters($mappingCount, $paramCount);
        }

        return QueryUtil::processParameterMappings($query, $paramMappings);
    }