# \hhu\z\questtypesBossfightQuesttypeModel

Model of the BossfightQuesttypeAgent for a boss-fight.

## Summary

Methods
Properties
Constants
load()
factory()
checkClass()
getBossFight()
getFirstStage()
getStageById()
getChildStages()
clearCharacterSubmissions()
setCharacterSubmission()
getCharacterSubmission()
No public properties found
No constants found
__construct()
$db
N/A
getClassName()
loadClass()
loadDriver()
connect()
loadModels()
No private properties found
N/A

File
  questtypes/bossfight/BossfightQuesttypeModel.inc
Package
  Default
Class hierarchy
  \nre\core\Model
  \nre\models\DatabaseModel
  \hhu\z\Model
  \hhu\z\models\QuesttypeModel
  \hhu\z\questtypes\BossfightQuesttypeModel

## Tags

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

## Properties

### $db

    $db : \nre\models\DatabaseDriver

Database connection

#### Type

\nre\models\DatabaseDriver

#

Inherited from
  \nre\models\DatabaseModel

## Tags

static |

## Methods

### load()

    load(string  $modelName)

Load the class of a Model.

#### Parameters

string | $modelName | Name of the Model to load

#### Throws

\nre\core\ModelNotFoundException
\nre\core\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

### checkClass()

    checkClass(string  $className, string  $parentClassName)

Check inheritance of the QuesttypeModel-class.

#### Parameters

string | $className | Name of the class to check
string | $parentClassName | Name of the parent class

#### Throws

\hhu\z\models\ClassNotValidException

#

static

Inherited from
  \hhu\z\models\QuesttypeModel

## Tags

static |

### getBossFight()

    getBossFight(integer  $questId) : array

Get a Boss-Fight.

#### Parameters

integer | $questId | ID of Quest

#### Throws

\hhu\z\questtypes\IdNotFoundException

#### Returns

array —

Boss-Fight data

#

## Tags

None found

### getFirstStage()

    getFirstStage(integer  $questId) : array

Get the first Stage to begin the Boss-Fight with.

#### Parameters

integer | $questId | ID of Quest

#### Returns

array —

Data of first Stage

#

## Tags

None found

### getStageById()

    getStageById(integer  $stageId) : array

Get a Stage by its ID.

#### Parameters

integer | $stageId | ID of Stage

#### Returns

array —

Stage data or null

#

## Tags

None found

### getChildStages()

    getChildStages(integer  $parentStageId) : array

Get the follow-up Stages for a Stage.

#### Parameters

integer | $parentStageId | ID of Stage to get follow-up Stages for

#### Returns

array —

List of follow-up Stages

#

## Tags

None found

### clearCharacterSubmissions()

    clearCharacterSubmissions(integer  $questId, integer  $characterId)

Reset all Character submissions of a Boss-Fight.

#### Parameters

integer | $questId | ID of Quest
integer | $characterId | ID of Character

#

## Tags

None found

### setCharacterSubmission()

    setCharacterSubmission(  $stageId, integer  $characterId)

Save Character’s submitted answer for one Boss-Fight-Stage.

#### Parameters

| $stageId |
integer | $characterId | ID of Character

#

## Tags

None found

### getCharacterSubmission()

    getCharacterSubmission(  $stageId, integer  $characterId) : boolean

Get answer of one Boss-Fight-Stage submitted by Character.

#### Parameters

| $stageId |
integer | $characterId | ID of Character

#### Returns

boolean —

Stage taken

#

## Tags

None found

### __construct()

    __construct()

Construct a new Model.

TODO Catch exception

#### Throws

\nre\core\DatamodelException
\nre\core\DriverNotFoundException
\nre\core\DriverNotValidException
\nre\core\ModelNotValidException
\nre\core\ModelNotFoundException

#

Inherited from
  \nre\core\Model

## 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

### loadClass()

    loadClass(string  $questtypeName, string  $fullClassName)

Load the class of a QuesttypeModel.

#### Parameters

string | $questtypeName | Name of the QuesttypeModel to load
string | $fullClassName | Name of the class to load

#### Throws

\hhu\z\models\ClassNotFoundException

#

static

Inherited from
  \hhu\z\models\QuesttypeModel

## Tags

static |

### loadDriver()

    loadDriver(string  $driverName)

Load the database driver.

#### Parameters

string | $driverName | Name of the database driver

#### Throws

\nre\models\DriverNotFoundException
\nre\models\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\models\DatamodelException

#

Inherited from
  \nre\models\DatabaseModel

## Tags

None found

### loadModels()

    loadModels()

Load the Models of this Model.

#### Throws

\nre\core\DatamodelException
\nre\core\DriverNotFoundException
\nre\core\DriverNotValidException
\nre\core\ModelNotValidException
\nre\core\ModelNotFoundException

#

Inherited from
  \nre\core\Model

## Tags

None found

### BossfightQuesttypeModel.inc