Documentation

Poll extends BaseMapper
in package

Mappers for Polls.

Tags
template-extends

BaseMapper<PollModel>

Table of Contents

Properties

$em  : EntityManager

Methods

__construct()  : mixed
count()  : int
detach()  : void
Detaches an entity from the entity manager causing any changed to be made to the object to be unsaved
find()  : T|null
findAll()  : array<string|int, T>
findBy()  : array<string|int, T>
findOneBy()  : T|null
findPollsApprovedByMember()  : array<string|int, Poll>
Get all polls approved by a specific member.
findPollsCreatedByMember()  : array<string|int, Poll>
Get all polls created by a specific member.
findVote()  : PollVote|null
Find the vote of a certain user on a poll.
findVotesByMember()  : array<string|int, PollVote>
Get all poll votes casted by a specific member.
flush()  : void
getConnection()  : Connection
Get the entity manager connection.
getEntityManager()  : EntityManager
Get the entity manager.
getNewestPoll()  : Poll|null
Returns the latest poll if one is available. Please note that this returns the poll which has its expiryDate furthest into the future, and thus not necessarily the 'newest' poll.
getPaginatorAdapter()  : DoctrinePaginator
Returns a paginator adapter for paging through all polls.
getUnapprovedPolls()  : array<string|int, Poll>
persist()  : void
persistMultiple()  : void
Persist multiple studies.
remove()  : void
removeById()  : void
Remove an entity by its ID using find
removeMultiple()  : void
Removes multiple studies.
transactional()  : mixed
Transactional Doctrine wrapper.
getRepository()  : EntityRepository
Get the repository for this mapper.
getRepositoryName()  : string

Properties

Methods

__construct()

public __construct(EntityManager $em) : mixed
Parameters
$em : EntityManager

count()

public count(mixed $criteria) : int
Parameters
$criteria : mixed

The criteria the objects to be counted should satisfy

Return values
int

The number of entities satisfying the criteria

detach()

Detaches an entity from the entity manager causing any changed to be made to the object to be unsaved

public detach(object $entity) : void
Parameters
$entity : object
Tags
psalm-param

T $entity

find()

public find(mixed $id) : T|null
Parameters
$id : mixed

The ID of the entity to be retrieved using the primary key

Return values
T|null

The entity corresponding to the provided ID or null of the entity cannot be found

findAll()

public findAll() : array<string|int, T>
Return values
array<string|int, T>

All entities in the repository

findBy()

public findBy(mixed $criteria) : array<string|int, T>
Parameters
$criteria : mixed

The criteria that describe the entity to be retrieved

Return values
array<string|int, T>

The entities corresponding to the provided criteria

findOneBy()

public findOneBy(array<string|int, mixed> $criteria) : T|null
Parameters
$criteria : array<string|int, mixed>

The criteria that describe the entity to be retrieved

Tags
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

Return values
T|null

The entity corresponding to the provided criteria or null of the entity cannot be found

findPollsApprovedByMember()

Get all polls approved by a specific member.

public findPollsApprovedByMember(Member $member) : array<string|int, Poll>
Parameters
$member : Member
Return values
array<string|int, Poll>

findPollsCreatedByMember()

Get all polls created by a specific member.

public findPollsCreatedByMember(Member $member) : array<string|int, Poll>
Parameters
$member : Member
Return values
array<string|int, Poll>

findVote()

Find the vote of a certain user on a poll.

public findVote(int $pollId, int|null $lidnr) : PollVote|null
Parameters
$pollId : int
$lidnr : int|null
Return values
PollVote|null

findVotesByMember()

Get all poll votes casted by a specific member.

public findVotesByMember(Member $member) : array<string|int, PollVote>
Parameters
$member : Member
Return values
array<string|int, PollVote>

flush()

public flush() : void
Tags
throws
ORMException
throws
OptimisticLockException

getConnection()

Get the entity manager connection.

public getConnection() : Connection
Return values
Connection

getEntityManager()

Get the entity manager.

public getEntityManager() : EntityManager
Return values
EntityManager

getNewestPoll()

Returns the latest poll if one is available. Please note that this returns the poll which has its expiryDate furthest into the future, and thus not necessarily the 'newest' poll.

public getNewestPoll() : Poll|null
Return values
Poll|null

getPaginatorAdapter()

Returns a paginator adapter for paging through all polls.

public getPaginatorAdapter() : DoctrinePaginator
Return values
DoctrinePaginator

getUnapprovedPolls()

public getUnapprovedPolls() : array<string|int, Poll>
Return values
array<string|int, Poll>

persist()

public persist(object $entity) : void
Parameters
$entity : object
Tags
psalm-param

T|LocalisedTextModel $entity

throws
ORMException

persistMultiple()

Persist multiple studies.

public persistMultiple(array<string|int, mixed> $entities) : void
Parameters
$entities : array<string|int, mixed>
Tags
psalm-param

T[] $entities

throws
ORMException

remove()

public remove(object $entity) : void
Parameters
$entity : object
Tags
psalm-param

T|LocalisedTextModel $entity

throws
ORMException

removeById()

Remove an entity by its ID using find

public removeById(mixed $id) : void
Parameters
$id : mixed
Tags
throws
EntityNotFoundException
throws
OptimisticLockException
throws
ORMException

removeMultiple()

Removes multiple studies.

public removeMultiple(array<string|int, mixed> $entities) : void
Parameters
$entities : array<string|int, mixed>
Tags
psalm-param

T[] $entities

throws
ORMException

transactional()

Transactional Doctrine wrapper.

public transactional(Closure $func) : mixed

Instead of the EntityManager, this inserts this Mapper into the function.

Parameters
$func : Closure

getRepository()

Get the repository for this mapper.

protected getRepository() : EntityRepository
Tags
psalm-return

EntityRepository<T>

Return values
EntityRepository

getRepositoryName()

protected getRepositoryName() : string
Return values
string

the name of the entity repository e.g. "User/Model/User"


        
On this page

Search results