Programming Language PHP

Namespace Oro\Component\DoctrineUtils\ORM

Class QueryBuilderUtil

Method/Function sprintf

Total Examples 2

2 code examples of PHP Oro\Component\DoctrineUtils\ORM\QueryBuilderUtil::sprintf extracted from open source projects

Was this example useful?
0
                                                    private function getIdentityExpr(string $entityAlias, string $fieldName, string $fieldAlias): string
    {
        return QueryBuilderUtil::sprintf('IDENTITY(%s.%s) AS %s', $entityAlias, $fieldName, $fieldAlias);
    }
                                            
Was this example useful?
0
                                                    /**
     * @inheritdoc
     */
    public function getTransformSelectQuery(
        $originalFieldName,
        QueryBuilder $qb = null,
        $rootAlias = null,
        $newFieldName = null
    ) {
        if (!$originalFieldName) {
            throw new \InvalidArgumentException('You must specify original field name for base currency query');
        }
        if (!$qb && !$rootAlias) {
            throw new \InvalidArgumentException('You must specify query builder or rootAlias for base currency query');
        }

        if (!$rootAlias) {
            $rootAliases = $qb->getRootAliases();
            $rootAlias = array_shift($rootAliases);
        }

        return QueryBuilderUtil::sprintf('%s.%sValue', $rootAlias, $originalFieldName);
    }