class PollRepository extends AbstractRepository

Class PollRepository

Traits

Class PublicationPeriodAwareTrait

Constants

TABLE_NAME

PRIMARY_KEY_COLUMN

Properties

protected Connection $db from AbstractRepository

Methods

__construct(Connection $db)

No description

bool|int
insert(array $data)

Executes the SQL insert statement

string
getTableName(string $tableName = '')

No description

bool|int
delete(int|array $entryId, string $columnName = self::PRIMARY_KEY_COLUMN)

Executes the SQL delete statement

bool|int
update(array $data, int|array $entryId)

Executes the SQL update statement

string
buildLimitStmt(int|string $limitStart = '', int|string $resultsPerPage = '')

Build the SQL limit

array
getOneById(int $entryId)

No description

string
getPublicationPeriod(string $tableAlias = '')

No description

bool
pollExists(int $pollId, string $time = '', bool $multiple = false)

No description

array
getOneByIdWithTotalVotes(int $pollId)

No description

array
countAll(string $status = '')

No description

array
getAll(string $time = '', string $limitStart = '', string $resultsPerPage = '')

No description

array
getLatestPoll(string $time)

No description

Details

in AbstractRepository at line 28
__construct(Connection $db)

Parameters

Connection $db

in AbstractRepository at line 39
bool|int insert(array $data)

Executes the SQL insert statement

Parameters

array $data

Return Value

bool|int

in AbstractRepository at line 55
string getTableName(string $tableName = '')

Parameters

string $tableName

Return Value

string

in AbstractRepository at line 67
bool|int delete(int|array $entryId, string $columnName = self::PRIMARY_KEY_COLUMN)

Executes the SQL delete statement

Parameters

int|array $entryId
string $columnName

Return Value

bool|int

in AbstractRepository at line 95
bool|int update(array $data, int|array $entryId)

Executes the SQL update statement

Parameters

array $data
int|array $entryId

Return Value

bool|int

in AbstractRepository at line 114
protected string buildLimitStmt(int|string $limitStart = '', int|string $resultsPerPage = '')

Build the SQL limit

Parameters

int|string $limitStart
int|string $resultsPerPage

Return Value

string

in AbstractRepository at line 130
array getOneById(int $entryId)

Parameters

int $entryId

Return Value

array

protected string getPublicationPeriod(string $tableAlias = '')

Parameters

string $tableAlias

Return Value

string

at line 28
bool pollExists(int $pollId, string $time = '', bool $multiple = false)

Parameters

int $pollId
string $time
bool $multiple

Return Value

bool

at line 41
array getOneByIdWithTotalVotes(int $pollId)

Parameters

int $pollId

Return Value

array

at line 54
array countAll(string $status = '')

Parameters

string $status

Return Value

array

at line 66
array getAll(string $time = '', string $limitStart = '', string $resultsPerPage = '')

Parameters

string $time
string $limitStart
string $resultsPerPage

Return Value

array

at line 81
array getLatestPoll(string $time)

Parameters

string $time

Return Value

array