* @since 1.0.0 */ protected static array $columns = [ 'qa_question_id' => ['name' => 'qa_question_id', 'type' => 'int', 'internal' => 'id'], 'qa_question_title' => ['name' => 'qa_question_title', 'type' => 'string', 'internal' => 'name'], 'qa_question_language' => ['name' => 'qa_question_language', 'type' => 'string', 'internal' => 'language'], 'qa_question_question' => ['name' => 'qa_question_question', 'type' => 'string', 'internal' => 'question'], 'qa_question_question_raw' => ['name' => 'qa_question_question_raw', 'type' => 'string', 'internal' => 'questionRaw'], 'qa_question_status' => ['name' => 'qa_question_status', 'type' => 'int', 'internal' => 'status'], 'qa_question_category' => ['name' => 'qa_question_category', 'type' => 'int', 'internal' => 'category'], 'qa_question_created_by' => ['name' => 'qa_question_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true], 'qa_question_created_at' => ['name' => 'qa_question_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true], ]; /** * Has many relation. * * @var array * @since 1.0.0 */ protected static array $hasMany = [ 'answers' => [ 'mapper' => QAAnswerMapper::class, 'table' => 'qa_answer', 'self' => 'qa_answer_question', 'external' => null, ], 'tags' => [ 'mapper' => TagMapper::class, 'table' => 'qa_tag', 'self' => 'qa_tag_dst', 'external' => 'qa_tag_src', ], ]; /** * Has many relation. * * @var array> * @since 1.0.0 */ protected static array $ownsOne = [ 'category' => [ 'mapper' => QACategoryMapper::class, 'external' => 'qa_question_category', ], ]; /** * Belongs to. * * @var array * @since 1.0.0 */ protected static array $belongsTo = [ 'createdBy' => [ 'mapper' => ProfileMapper::class, 'external' => 'qa_question_created_by', 'by' => 'account' ], ]; /** * Primary table. * * @var string * @since 1.0.0 */ protected static string $table = 'qa_question'; /** * Created at. * * @var string * @since 1.0.0 */ protected static string $createdAt = 'qa_question_created_at'; /** * Primary field name. * * @var string * @since 1.0.0 */ protected static string $primaryField = 'qa_question_id'; }