class EntityRelationshipManager implements BasicEntityManagerInterface, JQGridInterface

Class EntityRelationshipManager is injected as empire_entity_relationship_plugin.manager service. EntityRelationshipManager handles the logic for entity.

Traits

Trait JQGridManagerTrait

Constants

JOIN_ENTITY_DATA

Describes which classes should be always joined

LANGUAGE_DEPENDANT_ENTITY_RELATIONSHIP

Constant for entity relationships based on language difference

Methods

mixed
searchForJQGRID(array $searchParams, array $sortParams = array(), array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

No description

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

No description

mixed
getCountForJQGRID(array|null $searchParams = null, array|null $sortParams = null, array|null $additionalParams = array(), JQGridWrapper|null $jqGridWrapper = null)

No description

__construct(EntityRelationshipRepository $repository)

No description

save(EntityRelationship $relationship)

Save EntityRelationship

edit(EntityRelationship $relationship)

Edit EntityRelationship entity

bool
checkEntityTypesCombination(EntityRelationship $relationship)

Check if relationship can be added. One relationship name can only be used in one combination of main and sub entities

bool
delete(array $ids)

Gelete multiple relationships by array of ids

getRelationship(mixed $id)

Get single relationship for id

array
getAllEntities()

Get all entities that implement RelationshipEntityInterface

array
getPropertiesForClass(string $class)

Get all properties of specified class

array
searchEntity(string $class, string $field, string $view, string $query, int $page = 1, int $offset = 10)

Search specified class

array
selectEntity(string $class, string $view, array $ids)

Get all specified elements

array
getEntityRelationshipNames()

Get all distinct relationship names

array
getRelationshipData(string $title, array $ids)

Get data for relationships

array
getLanguageRelatedEntity(string $class, array $paramBag, string $targetLocale)

Get ids of class for specified array of params

Details

in JQGridManagerTrait at line 26
mixed searchForJQGRID(array $searchParams, array $sortParams = array(), array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

Parameters

array $searchParams
array $sortParams
array $additionalParams
JQGridWrapper $jqGridWrapper

Return Value

mixed

in JQGridManagerTrait at line 40
mixed findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

Parameters

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

Return Value

mixed

in JQGridManagerTrait at line 53
mixed getCountForJQGRID(array|null $searchParams = null, array|null $sortParams = null, array|null $additionalParams = array(), JQGridWrapper|null $jqGridWrapper = null)

Parameters

array|null $searchParams
array|null $sortParams
array|null $additionalParams
JQGridWrapper|null $jqGridWrapper

Return Value

mixed

at line 48
__construct(EntityRelationshipRepository $repository)

Parameters

EntityRelationshipRepository $repository

at line 62
EntityRelationship|int|PrimaryKeyInterface save(EntityRelationship $relationship)

Save EntityRelationship

Parameters

EntityRelationship $relationship

Return Value

EntityRelationship|int|PrimaryKeyInterface

Exceptions

NoResultException
NonUniqueResultException

at line 81
EntityRelationship|int|PrimaryKeyInterface edit(EntityRelationship $relationship)

Edit EntityRelationship entity

Parameters

EntityRelationship $relationship

Return Value

EntityRelationship|int|PrimaryKeyInterface

Exceptions

NoResultException
NonUniqueResultException

at line 100
bool checkEntityTypesCombination(EntityRelationship $relationship)

Check if relationship can be added. One relationship name can only be used in one combination of main and sub entities

Parameters

EntityRelationship $relationship

Return Value

bool

Exceptions

NoResultException
NonUniqueResultException

at line 111
bool delete(array $ids)

Gelete multiple relationships by array of ids

Parameters

array $ids

Return Value

bool

at line 123
EntityRelationship getRelationship(mixed $id)

Get single relationship for id

Parameters

mixed $id

Return Value

EntityRelationship

at line 134
array getAllEntities()

Get all entities that implement RelationshipEntityInterface

Return Value

array

Exceptions

ReflectionException

at line 145
array getPropertiesForClass(string $class)

Get all properties of specified class

Parameters

string $class

Return Value

array

at line 163
array searchEntity(string $class, string $field, string $view, string $query, int $page = 1, int $offset = 10)

Search specified class

Parameters

string $class
  • Class to search
string $field
  • Field to search
string $view
  • Display results as
string $query
  • Query string
int $page
  • Page of data
int $offset
  • Number of items per page

Return Value

array

Exceptions

MappingException

at line 176
array selectEntity(string $class, string $view, array $ids)

Get all specified elements

Parameters

string $class
  • Class to search
string $view
  • Field to view as results
array $ids
  • ids of elements to display

Return Value

array

at line 185
array getEntityRelationshipNames()

Get all distinct relationship names

Return Value

array

at line 199
array getRelationshipData(string $title, array $ids)

Get data for relationships

Parameters

string $title
array $ids

Return Value

array

Exceptions

DBALException

at line 273
array getLanguageRelatedEntity(string $class, array $paramBag, string $targetLocale)

Get ids of class for specified array of params

Parameters

string $class
array $paramBag
string $targetLocale

Return Value

array

Exceptions

NonUniqueResultException
DBALException