class FormRepository extends TranslatableRepository implements AbstractBlockElementRepositoryInterface

Class FormRepository is injected as form.builder.repository service. FormRepository is used for crud operation for entity.

Use this class to work with database.

Traits

Trait JQGridTrait

Constants

TRANSLATION_WALKER_HINT

FORM_BLOCKS_RESULT_CACHE

Cache key

ALIAS

Alias for entity

Properties

protected string $defaultLocale from TranslatableRepository

Methods

setDefaultLocale(string $locale)

Sets default locale

QueryBuilder
getOneOrNullResult(QueryBuilder $qb, string $locale = null, string $hydrationMode = null)

Returns translated one (or null if not found) result for given locale

mixed
getResult(QueryBuilder $qb, string $locale = null, int $hydrationMode = AbstractQuery::HYDRATE_OBJECT)

Returns translated results for given locale

array
getArrayResult(QueryBuilder $qb, string $locale = null)

Returns translated array results for given locale

QueryBuilder
getSingleResult(QueryBuilder $qb, string $locale = null, string $hydrationMode = null)

Returns translated single result for given locale

array
getScalarResult(QueryBuilder $qb, string $locale = null)

Returns translated scalar result for given locale

QueryBuilder
getSingleScalarResult(QueryBuilder $qb, string $locale = null)

Returns translated single scalar result for given locale

remove(mixed $entity)

Remove entity

bool
removeArray(array $arrayOfEntities)

Remove entities provided as array

edit(PrimaryKeyInterface $entity)

Sets default locale to entity and merge

mixed
getAll()

Find all entities depending on locale

mixed
getByPrimaryKey(PrimaryKeyInterface $entity)

Find entity by primary key

QueryBuilder
getById(int $id)

Find entity by id

QueryBuilder|array
getGroupFromDB(array $array)

Find group od entities

EntityManager
getManager()

Singleton

mixed
saveCollection(array $array)

Persist collection

array
getLanguagesForIds(array $ids)

Find all locales for custom ids of entities

Query
getTranslatedQuery(QueryBuilder $qb, string $locale = null)

Returns translated Doctrine query instance

startTransaction()

Begins transaction over database

commitTransaction()

Commit transaction over database

rollbackTransaction()

Rollback transaction over database

string
getAlias()

No description

jQGridJoinFields(QueryBuilder $qb, JQGridWrapper $jqGridWrapper)

All joins used in select.

jQGridGroupByFields(QueryBuilder $qb, JQGridWrapper $jqGridWrapper)

Should contain group by which jqgrid uses.

array
findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams, JQGridWrapper $jqGridWrapper)

JQGrid function

array
searchForJQGRID(array $searchParams, array $sortParams, bool $isCountSearch = false, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

JQGrid function

mixed
deleteForms(array $ids)

Delete forms by ids

array
getEntitiesForBlockElementsExtension(array $ids)

No description

array
getEntityNamesForIds(array $ids)

No description

deleteResultCaches()

Delete all cached results

mixed
getReference(int $id, string $class = Form::class)

Get reference to class

Details

setDefaultLocale(string $locale)

Sets default locale

Parameters

string $locale

QueryBuilder getOneOrNullResult(QueryBuilder $qb, string $locale = null, string $hydrationMode = null)

Returns translated one (or null if not found) result for given locale

Parameters

QueryBuilder $qb A Doctrine query builder instance
string $locale A locale name
string $hydrationMode A Doctrine results hydration mode

Return Value

QueryBuilder

Exceptions

NonUniqueResultException

mixed getResult(QueryBuilder $qb, string $locale = null, int $hydrationMode = AbstractQuery::HYDRATE_OBJECT)

Returns translated results for given locale

Parameters

QueryBuilder $qb A Doctrine query builder instance
string $locale A locale name
int $hydrationMode A Doctrine results hydration mode

Return Value

mixed

array getArrayResult(QueryBuilder $qb, string $locale = null)

Returns translated array results for given locale

Parameters

QueryBuilder $qb A Doctrine query builder instance
string $locale A locale name

Return Value

array

in TranslatableRepository at line 102
QueryBuilder getSingleResult(QueryBuilder $qb, string $locale = null, string $hydrationMode = null)

Returns translated single result for given locale

Parameters

QueryBuilder $qb A Doctrine query builder instance
string $locale A locale name
string $hydrationMode A Doctrine results hydration mode

Return Value

QueryBuilder

Exceptions

NoResultException
NonUniqueResultException

in TranslatableRepository at line 115
array getScalarResult(QueryBuilder $qb, string $locale = null)

Returns translated scalar result for given locale

Parameters

QueryBuilder $qb A Doctrine query builder instance
string $locale A locale name

Return Value

array

in TranslatableRepository at line 130
QueryBuilder getSingleScalarResult(QueryBuilder $qb, string $locale = null)

Returns translated single scalar result for given locale

Parameters

QueryBuilder $qb A Doctrine query builder instance
string $locale A locale name

Return Value

QueryBuilder

Exceptions

NonUniqueResultException

in TranslatableRepository at line 142
PrimaryKeyInterface save(PrimaryKeyInterface $entity)

Parameters

PrimaryKeyInterface $entity

Return Value

PrimaryKeyInterface

Exceptions

Exception

in TranslatableRepository at line 172
remove(mixed $entity)

Remove entity

Parameters

mixed $entity

Exceptions

Exception

in TranslatableRepository at line 200
bool removeArray(array $arrayOfEntities)

Remove entities provided as array

Parameters

array $arrayOfEntities

Return Value

bool

Exceptions

Exception

in TranslatableRepository at line 228
PrimaryKeyInterface edit(PrimaryKeyInterface $entity)

Sets default locale to entity and merge

Parameters

PrimaryKeyInterface $entity

Return Value

PrimaryKeyInterface

Exceptions

Exception

in TranslatableRepository at line 253
mixed getAll()

Find all entities depending on locale

Return Value

mixed

in TranslatableRepository at line 270
mixed getByPrimaryKey(PrimaryKeyInterface $entity)

Find entity by primary key

Parameters

PrimaryKeyInterface $entity

Return Value

mixed

Exceptions

NoResultException
NonUniqueResultException

in TranslatableRepository at line 291
QueryBuilder getById(int $id)

Find entity by id

Parameters

int $id

Return Value

QueryBuilder

Exceptions

NoResultException
NonUniqueResultException

in TranslatableRepository at line 307
QueryBuilder|array getGroupFromDB(array $array)

Find group od entities

Parameters

array $array Objects

Return Value

QueryBuilder|array

in TranslatableRepository at line 332
EntityManager getManager()

Singleton

Return Value

EntityManager

in TranslatableRepository at line 352
mixed saveCollection(array $array)

Persist collection

Parameters

array $array

Return Value

mixed

Exceptions

Exception

in TranslatableRepository at line 379
array getLanguagesForIds(array $ids)

Find all locales for custom ids of entities

Parameters

array $ids

Return Value

array

in TranslatableRepository at line 396
protected Query getTranslatedQuery(QueryBuilder $qb, string $locale = null)

Returns translated Doctrine query instance

Parameters

QueryBuilder $qb A Doctrine query builder instance
string $locale A locale name

Return Value

Query

in TranslatableRepository at line 404
protected startTransaction()

Begins transaction over database

in TranslatableRepository at line 412
protected commitTransaction()

Commit transaction over database

in TranslatableRepository at line 420
protected rollbackTransaction()

Rollback transaction over database

at line 41
string getAlias()

Return Value

string

in JQGridTrait at line 27
jQGridJoinFields(QueryBuilder $qb, JQGridWrapper $jqGridWrapper)

All joins used in select.

Override in the repository class if needed. Should do nothing otherwise

Parameters

QueryBuilder $qb
JQGridWrapper $jqGridWrapper

in JQGridTrait at line 42
jQGridGroupByFields(QueryBuilder $qb, JQGridWrapper $jqGridWrapper)

Should contain group by which jqgrid uses.

Override in the repository class if needed. Should do nothing otherwise

Parameters

QueryBuilder $qb
JQGridWrapper $jqGridWrapper

in JQGridTrait at line 61
array findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams, JQGridWrapper $jqGridWrapper)

JQGrid function

Parameters

int $page
int $offset
array $sortParams
array $additionalParams
JQGridWrapper $jqGridWrapper

Return Value

array

in JQGridTrait at line 94
array searchForJQGRID(array $searchParams, array $sortParams, bool $isCountSearch = false, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

JQGrid function

Parameters

array $searchParams
array $sortParams
bool $isCountSearch
array $additionalParams
JQGridWrapper $jqGridWrapper

Return Value

array

at line 52
mixed deleteForms(array $ids)

Delete forms by ids

Parameters

array $ids

Return Value

mixed

at line 63
array getEntitiesForBlockElementsExtension(array $ids)

Parameters

array $ids

Return Value

array

at line 84
array getEntityNamesForIds(array $ids)

Parameters

array $ids

Return Value

array

at line 102
deleteResultCaches()

Delete all cached results

at line 116
mixed getReference(int $id, string $class = Form::class)

Get reference to class

Parameters

int $id
string $class

Return Value

mixed

Exceptions

ORMException