# \hhu\z\modelsQuesttypeModel

Abstract class for implementing a QuesttypeModel.

## Summary

Methods
Properties
Constants
__construct()
load()
factory()
checkClass()
No public properties found
No constants found
No protected methods found
$db
N/A
loadDriver()
connect()
getClassName()
loadModels()
loadClass()
No private properties found
N/A
abstract

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

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

### __construct()

    __construct()

Construct a new QuesttypeModel.

TODO Catch exception

#### Throws

\nre\exceptions\DatamodelException
\nre\exceptions\DriverNotFoundException
\nre\exceptions\DriverNotValidException
\hhu\z\exceptions\QuesttypeModelNotValidException
\hhu\z\exceptions\QuesttypeModelNotFoundException

#

## Tags

None found

### load()

    load(string  $modelName)

Load a Model.

#### Parameters

string | $modelName | Name of the QuesttypeModel to load

#### Throws

\hhu\z\exceptions\QuesttypeModelNotFoundException
\hhu\z\exceptions\QuesttypeModelNotValidException

#

static

## Tags

static |

### factory()

    factory(string  $questtypeName)

Instantiate a QuesttypeModel (Factory Pattern).

#### Parameters

string | $questtypeName | Name of the QuesttypeModel to instantiate

#

static

## Tags

static |

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

\nre\exceptions\ClassNotValidException

#

static

## Tags

static |

### 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  $questtypeName) : string

Determine the Model-classname for the given Questtype-name.

#### Parameters

string | $questtypeName | Questtype-name to get Model-classname of

#### Returns

string —

Classname for the Questtype-name

#

static

## Tags

static |

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

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

\nre\exceptions\ClassNotFoundException

#

static

## Tags

static |

### QuesttypeModel.inc