# \hhu\z\modelsQuestgrouptextsModel

Model to interact with Questgrouptexts-table.

## Summary

Methods
Properties
Constants
__construct()
load()
factory()
getQuestgroupTexts()
getFirstQuestgroupText()
addQuestgrouptextToQuestgroup()
editQuestgrouptext()
deleteQuestgrouptext()
$models
No constants found
No protected methods found
$db
N/A
loadDriver()
connect()
getClassName()
loadModels()
No private properties found
N/A

File
  models/QuestgrouptextsModel.inc
Package
  Default
Class hierarchy
  \nre\core\Model
  \nre\models\DatabaseModel
  \hhu\z\Model
  \hhu\z\models\QuestgrouptextsModel

## Tags

author | Oliver Hanraths oliver.hanraths@uni-duesseldorf.de

## Properties

### $models

    $models : array

Required models

#### Type

array

#

## Tags

None found

### $db

    $db : \nre\models\DatabaseDriver

Database connection

#### Type

\nre\models\DatabaseDriver

#

Inherited from
  \nre\models\DatabaseModel

## Tags

static |

## Methods

### __construct()

    __construct()

Construct a new QuestgrouptextsModel.

TODO Catch exception

#

## Tags

None found

### load()

    load(string  $modelName)

Load the class of a Model.

#### Parameters

string | $modelName | Name of the Model to load

#### Throws

\nre\exceptions\ModelNotFoundException
\nre\exceptions\ModelNotValidException

#

static

Inherited from
  \nre\core\Model

## Tags

None found

### factory()

    factory(string  $modelName)

Instantiate a Model (Factory Pattern).

#### Parameters

string | $modelName | Name of the Model to instantiate

#

static

Inherited from
  \nre\core\Model

## Tags

None found

### getQuestgroupTexts()

    getQuestgroupTexts(integer  $questgroupId) : array

Get texts of a Questgroup.

#### Parameters

integer | $questgroupId | ID of a Questgroup

#### Returns

array —

Texts of this Questgroup

#

## Tags

None found

### getFirstQuestgroupText()

    getFirstQuestgroupText(integer  $questgroupId) : string

Get the first text of a Questgroup.

#### Parameters

integer | $questgroupId | ID of a Questgroup

#### Returns

string —

First text of this Questgroup or NULL

#

## Tags

None found

### addQuestgrouptextToQuestgroup()

    addQuestgrouptextToQuestgroup(integer  $userId, integer  $questgroupId, string  $text)

Add a Questgroup text to a Questgroup.

#### Parameters

integer | $userId | ID of user
integer | $questgroupId | ID of Questgroup to add text to
string | $text | Text to add

#

## Tags

None found

### editQuestgrouptext()

    editQuestgrouptext(integer  $questgrouptextId, string  $text)

Edit a Questgroup text.

#### Parameters

integer | $questgrouptextId | ID of Questgroup text to edit
string | $text | New text

#

## Tags

None found

### deleteQuestgrouptext()

    deleteQuestgrouptext(array  $questgrouptext)

Delete a Questgroup text.

#### Parameters

array | $questgrouptext | Data of Questgroup text to delete

#

## Tags

None found

### loadDriver()

    loadDriver(string  $driverName)

Load the database driver.

#### Parameters

string | $driverName | Name of the database driver

#### Throws

\nre\exceptions\DriverNotFoundException
\nre\exceptions\DriverNotValidException

#

Inherited from
  \nre\models\DatabaseModel

## Tags

None found

### connect()

    connect(string  $driverName, array  $config)

Establish a connection to the database.

#### Parameters

string | $driverName | Name of the database driver
array | $config | Connection settings

#### Throws

\nre\exceptions\DatamodelException

#

Inherited from
  \nre\models\DatabaseModel

## Tags

None found

### getClassName()

    getClassName(string  $modelName) : string

Determine the classname for the given Model name.

#### Parameters

string | $modelName | Model name to get classname of

#### Returns

string —

Classname fore the Model name

#

static

Inherited from
  \nre\core\Model

## Tags

None found

### loadModels()

    loadModels()

Load the Models of this Model.

#### Throws

\nre\exceptions\DatamodelException
\nre\exceptions\DriverNotFoundException
\nre\exceptions\DriverNotValidException
\nre\exceptions\ModelNotValidException
\nre\exceptions\ModelNotFoundException

#

Inherited from
  \nre\core\Model

## Tags

None found

### QuestgrouptextsModel.inc