TranslatableRepository
abstract class TranslatableRepository extends EntityRepository
Abstract class TranslatableRepository needs to be extended in all custom repositories whose entity is locale dependent
Constants
| TRANSLATION_WALKER_HINT |
|
Properties
| protected string | $defaultLocale |
Methods
Sets default locale
Returns translated one (or null if not found) result for given locale
Returns translated results for given locale
Returns translated array results for given locale
Returns translated single result for given locale
Returns translated scalar result for given locale
Returns translated single scalar result for given locale
Remove entity
Remove entities provided as array
Find all entities depending on locale
Find entity by id
Find group od entities
Singleton
Persist collection
Find all locales for custom ids of entities
Returns translated Doctrine query instance
Begins transaction over database
Commit transaction over database
Rollback transaction over database
No description
Details
at line 41
setDefaultLocale(string $locale)
Sets default locale
at line 57
QueryBuilder
getOneOrNullResult(QueryBuilder $qb, string $locale = null, string $hydrationMode = null)
Returns translated one (or null if not found) result for given locale
at line 72
mixed
getResult(QueryBuilder $qb, string $locale = null, int $hydrationMode = AbstractQuery::HYDRATE_OBJECT)
Returns translated results for given locale
at line 85
array
getArrayResult(QueryBuilder $qb, string $locale = null)
Returns translated array results for given locale
at line 102
QueryBuilder
getSingleResult(QueryBuilder $qb, string $locale = null, string $hydrationMode = null)
Returns translated single result for given locale
at line 115
array
getScalarResult(QueryBuilder $qb, string $locale = null)
Returns translated scalar result for given locale
at line 130
QueryBuilder
getSingleScalarResult(QueryBuilder $qb, string $locale = null)
Returns translated single scalar result for given locale
at line 142
PrimaryKeyInterface
save(PrimaryKeyInterface $entity)
at line 172
remove(mixed $entity)
Remove entity
at line 200
bool
removeArray(array $arrayOfEntities)
Remove entities provided as array
at line 228
PrimaryKeyInterface
edit(PrimaryKeyInterface $entity)
Sets default locale to entity and merge
at line 253
mixed
getAll()
Find all entities depending on locale
at line 270
mixed
getByPrimaryKey(PrimaryKeyInterface $entity)
Find entity by primary key
at line 291
QueryBuilder
getById(int $id)
Find entity by id
at line 307
QueryBuilder|array
getGroupFromDB(array $array)
Find group od entities
at line 332
EntityManager
getManager()
Singleton
at line 352
mixed
saveCollection(array $array)
Persist collection
at line 379
array
getLanguagesForIds(array $ids)
Find all locales for custom ids of entities
at line 396
protected Query
getTranslatedQuery(QueryBuilder $qb, string $locale = null)
Returns translated Doctrine query instance
at line 404
protected
startTransaction()
Begins transaction over database
at line 412
protected
commitTransaction()
Commit transaction over database
at line 420
protected
rollbackTransaction()
Rollback transaction over database