qbbr/pgsql-doctrine-random-function
PgsqlDoctrineRandomFunction
PostgreSQL RANDOM() function for Doctrine ORM
Installation
Step 1: Download the package
$ composer require qbbr/pgsql-doctrine-random-function
Step 2: Configuration
# app/config/config.yml
doctrine:
orm:
# ...
dql:
numeric_functions:
Random: Qbbr\PgsqlDoctrineRandomFunction\DQL\RandomFunction
Usage
$em = $this->getDoctrine()->getManager();
$result = $em->createQueryBuilder()
->select('e')
->from('AppBundle:Entity', 'e')
->orderBy('RANDOM()')
->setMaxResults(10)
->getQuery()
->getResult();
Related Packages
fresh/doctrine-enum-bundle
Provides support of ENUM type for Doctrine2 in Symfony applications.
7,081,560
461
martin-georgiev/postgresql-for-doctrine
Extends Doctrine with native PostgreSQL support for arrays, JSONB, ranges, PostG...
5,973,650
456
array-data-types
arrays
binary-data
cidr
date-interval
dbal
doctrine
doctrine-dbal
doctrine-dql
doctrine-orm
doctrine-types
dql
embeddings
full-text-search
fuzzystrmatch
geo
geography
geometry
geospatial
gis
hash-store
hstore
inet
json
json-data
jsonb
jsonpath
levenshtein
ltree
macaddr
martin-georgiev
math-functions
money
multirange
network-types
pgsql
pgvector
postgis
postgis-geometry
postgres
postgres-extension
postgresql
range
soundex
spatial
text-search
trigonometry
tsquery
tsvector
uuid
vector
vector-search
xml