Properties

$db

$db : \nre\models\DatabaseDriver

Database connection

Type

\nre\models\DatabaseDriver

Methods

__construct()

__construct() 

Construct a new QuestgroupshierarchyModel.

TODO Catch exception

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

factory()

factory(string  $modelName) 

Instantiate a Model (Factory Pattern).

Parameters

string $modelName

Name of the Model to instantiate

getHierarchyById()

getHierarchyById(integer  $questgroupshierarchyId) : array

Get a Questgroup hierarchy by its ID.

throws \nre\exceptions\IdNotFoundException

Parameters

integer $questgroupshierarchyId

ID of a Questgroup hierarchy

Returns

array —

Questgroup hierarchy

getHierarchyByUrl()

getHierarchyByUrl(integer  $seminaryId,   $questgroupshierarchyUrl) : array

Get a Questgroup hierarchy by its URL.

Parameters

integer $seminaryId

ID of Seminary

$questgroupshierarchyUrl

Throws

\nre\exceptions\IdNotFoundException

Returns

array —

Questgroup hierarchy

getHierarchyOfSeminary()

getHierarchyOfSeminary(integer  $seminaryId) : array

Get the toplevel hierarchy entries of a Seminary.

Parameters

integer $seminaryId

ID of the seminary to get hierarchy for

Returns

array —

Toplevel hierarchy

getHierarchyForQuestgroup()

getHierarchyForQuestgroup(integer  $questgroupId) : array

Get the Questgroup-Hierarchy for a Questgroup.

Parameters

integer $questgroupId

ID of Questgroup

Returns

array —

Hierarchy for Questgroup

getChildQuestgroupshierarchy()

getChildQuestgroupshierarchy(integer  $questgroupshierarchyId) : array

Get the child hierarchy entries of a Questgroup hierarchy.

Parameters

integer $questgroupshierarchyId

ID of a Questgroup hierarchy

Returns

array —

Child Questgroup hierarchy entries

questgroupshierarchyTitleSingularExists()

questgroupshierarchyTitleSingularExists(string  $title, integer  $seminaryId, integer  $questgroupshierarchyId = null) : \hhu\z\models\Whether

Check if a title for a Questgroupshierarchy already exists for a Seminary.

Parameters

string $title
integer $seminaryId
integer $questgroupshierarchyId

Do not check this Questgroupshierarchy (for editing)

Returns

\hhu\z\models\Whether —

title already exists or not

createQuestgroupshierarchy()

createQuestgroupshierarchy(integer  $userId, integer  $seminaryId, integer  $parentQuestgroupsierarchyId,   $titleSingular,   $titlePlural) 

Create a new Questgroupshierarchy for a Seminary

Parameters

integer $userId

ID of creating user

integer $seminaryId

ID of Seminary

integer $parentQuestgroupsierarchyId

ID of parent Questgroupshierarchy

$titleSingular
$titlePlural

editQuestgroupshierarchy()

editQuestgroupshierarchy(integer  $questgroupshierarchyId,   $titleSingular,   $titlePlural) 

Edit a Questgroupshierarchy.

Parameters

integer $questgroupshierarchyId

ID of Questgroupshierarchy to edit

$titleSingular
$titlePlural

moveQuestgroupshierarchy()

moveQuestgroupshierarchy(array  $questgroupshierarchy, boolean  $up) 

Move a Questgroupshierarchy up (decrement position) or down (increment position).

Parameters

array $questgroupshierarchy

Questgroupshierarchy to move

boolean $up

True for moving up, false for down

deleteQuestgroupshierarchy()

deleteQuestgroupshierarchy(  $questgroupshierarchyId) 

Delete a Questgroupshierarchy.

Parameters

$questgroupshierarchyId

loadDriver()

loadDriver(string  $driverName) 

Load the database driver.

Parameters

string $driverName

Name of the database driver

Throws

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

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

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

loadModels()

loadModels() 

Load the Models of this Model.

Throws

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