class MyTeamRepository extends EntityRepository implements AbstractBlockElementRepositoryInterface

Class MyTeamRepository is injected as empire_my_team_plugin.my_team_repository service. MyTeamRepository is used for crud operation for entity.

Use this class to work with database.

Traits

Trait JQGridTrait

Constants

MY_TEAM_CACHE_RESULTS

ALIAS

Alias for entity

USER_ALIAS

Alias for user entity

AGGREGATION_ALIAS

Alias for user aggregation entity

IMAGE_ALIAS

Alias for image entity

Methods

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

EntityManager
getEntityManager()

Retrieve entity manager

array
getTeamForSort(int $id)

Find team(as array) for provided id

array
getTeamByPk(int $id)

Find one team for provided id

array
getTeamForFrontendFromDB(int $teamId)

Find one team(with relationships) for provided id

array
getForFrontend(string $slug)

Find one team(with relationships) for provided id

array
getAllTeamsForFrontend()

Find id, name and slug for all teams

mixed
getTeamForEditFromDBTemp(MyTeam $team)

Find one team(with relationships) for provided id

mixed
saveItem(mixed $item)

Persist new team

mixed
editItem(MyTeam $myTeam)

Update existing team

bool
removeTeams(array $arrayOfTeams)

Remove array of teams for provided ids

getReference(int $id)

No description

array
getEntitiesForBlockElementsExtension(array $ids)

Get entities from database by ids Tis method is used to for block elements extension Make sure you order data by ids - ids is array of elements and it is sorted by priority - so add this to select -> ' FIELD('.self::ALIAS.'.id'.', '.implode(', ', $ids).') AS sort_col'); - and order by this field Also make sure you cache this data -> qb->useQueryCache(true)->useResultCache(true, 3600)

array
getEntityNamesForIds(array $ids)

Get id and name (field must be name so change it in select) of entity Used in event for block element edit Make sure you order data by ids - ids is array of elements and it is sorted by priority - so add this to select -> ' FIELD('.self::ALIAS.'.id'.', '.implode(', ', $ids).') AS sort_col'); - and order by this field

array
getTeamsForBlock(array $ids)

Find teams that match provided ids

deleteResultCaches()

delete all cached results

Details

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 65
EntityManager getEntityManager()

Retrieve entity manager

Return Value

EntityManager

at line 77
array getTeamForSort(int $id)

Find team(as array) for provided id

Parameters

int $id

Return Value

array

at line 109
array getTeamByPk(int $id)

Find one team for provided id

Parameters

int $id

Return Value

array

Exceptions

NonUniqueResultException

at line 127
array getTeamForFrontendFromDB(int $teamId)

Find one team(with relationships) for provided id

Parameters

int $teamId

Return Value

array

Exceptions

NonUniqueResultException

at line 155
array getForFrontend(string $slug)

Find one team(with relationships) for provided id

Parameters

string $slug

Return Value

array

Exceptions

NonUniqueResultException

at line 174
array getAllTeamsForFrontend()

Find id, name and slug for all teams

Return Value

array

at line 191
mixed getTeamForEditFromDBTemp(MyTeam $team)

Find one team(with relationships) for provided id

Parameters

MyTeam $team

Return Value

mixed

Exceptions

NonUniqueResultException

at line 215
mixed saveItem(mixed $item)

Persist new team

Parameters

mixed $item

Return Value

mixed

at line 236
mixed editItem(MyTeam $myTeam)

Update existing team

Parameters

MyTeam $myTeam

Return Value

mixed

at line 257
bool removeTeams(array $arrayOfTeams)

Remove array of teams for provided ids

Parameters

array $arrayOfTeams

Return Value

bool

at line 282
MyTeam getReference(int $id)

Parameters

int $id

Return Value

MyTeam

Exceptions

ORMException

at line 298
array getEntitiesForBlockElementsExtension(array $ids)

Get entities from database by ids Tis method is used to for block elements extension Make sure you order data by ids - ids is array of elements and it is sorted by priority - so add this to select -> ' FIELD('.self::ALIAS.'.id'.', '.implode(', ', $ids).') AS sort_col'); - and order by this field Also make sure you cache this data -> qb->useQueryCache(true)->useResultCache(true, 3600)

Parameters

array $ids

Return Value

array

at line 313
array getEntityNamesForIds(array $ids)

Get id and name (field must be name so change it in select) of entity Used in event for block element edit Make sure you order data by ids - ids is array of elements and it is sorted by priority - so add this to select -> ' FIELD('.self::ALIAS.'.id'.', '.implode(', ', $ids).') AS sort_col'); - and order by this field

Parameters

array $ids

Return Value

array

at line 335
array getTeamsForBlock(array $ids)

Find teams that match provided ids

Parameters

array $ids

Return Value

array

at line 358
deleteResultCaches()

delete all cached results