AnswersManager
in package
Class AnswersManager
Tags
Table of Contents
- COLUMN_COMMENT = 'comment'
- COLUMN_ID = 'id'
- COLUMN_IS_RIGHT = 'is_right'
- COLUMN_QUESTION_ID = 'question_id'
- COLUMN_SORT = 'sort'
- COLUMN_TEXT = 'text'
- TABLE_NAME = 'answers'
- $database : Context
- __construct() : mixed
- add() : array<string|int, mixed>|bool|int|iteratable<string|int, mixed>|ActiveRow|Selection|Traversable
- deleteQuestionAnswers() : int
- Deletes question answer
- get() : ActiveRow
- getAnswerByQuestionAndTitle() : ActiveRow|null
- getAnswersQuestion() : array<string|int, ActiveRow>
- Get answers question
- getAnswersQuestionWithMeta() : mixed
- getIsRightAnswerQuestion() : array<string|int, ActiveRow>
- update() : ActiveRow
Constants
COLUMN_COMMENT
public
string
COLUMN_COMMENT
= 'comment'
COLUMN_ID
public
string
COLUMN_ID
= 'id'
COLUMN_IS_RIGHT
public
string
COLUMN_IS_RIGHT
= 'is_right'
COLUMN_QUESTION_ID
public
string
COLUMN_QUESTION_ID
= 'question_id'
COLUMN_SORT
public
string
COLUMN_SORT
= 'sort'
COLUMN_TEXT
public
string
COLUMN_TEXT
= 'text'
TABLE_NAME
public
string
TABLE_NAME
= 'answers'
Properties
$database
private
Context
$database
Methods
__construct()
public
__construct(Context $database) : mixed
Parameters
- $database : Context
Return values
mixed —add()
public
add(iteratable<string|int, mixed> $data) : array<string|int, mixed>|bool|int|iteratable<string|int, mixed>|ActiveRow|Selection|Traversable
Parameters
- $data : iteratable<string|int, mixed>
Tags
Return values
array<string|int, mixed>|bool|int|iteratable<string|int, mixed>|ActiveRow|Selection|Traversable —deleteQuestionAnswers()
Deletes question answer
public
deleteQuestionAnswers( $question_id) : int
Parameters
Tags
Return values
int —get()
public
get(int $id) : ActiveRow
Parameters
- $id : int
Tags
Return values
ActiveRow —getAnswerByQuestionAndTitle()
public
getAnswerByQuestionAndTitle(string $text, int $question_id) : ActiveRow|null
Parameters
- $text : string
- $question_id : int
Return values
ActiveRow|null —getAnswersQuestion()
Get answers question
public
getAnswersQuestion( $question_id) : array<string|int, ActiveRow>
Parameters
Return values
array<string|int, ActiveRow> —getAnswersQuestionWithMeta()
public
getAnswersQuestionWithMeta(mixed $question_id) : mixed
Parameters
- $question_id : mixed
Return values
mixed —getIsRightAnswerQuestion()
public
getIsRightAnswerQuestion( $question_id) : array<string|int, ActiveRow>
Parameters
Tags
Return values
array<string|int, ActiveRow> —update()
public
update( $id, iteratable<string|int, mixed> $data) : ActiveRow