File: common/dblibraryBookObject.php

Return to Documentation

Class: dblibraryBookObject
createBookObject (2)
updateBookObject (3)
deleteBookObject (4)
getBookObject (5)
getBookPages (6)
createPageObject (7)
updatePageObject (8)
deletePageObject (9)
getPageObject (10)
pageHasQuestion (11)
getQuestionObjectFromPage (12)
createQuestionObject (13)
updateQuestionObject (14)
deleteQuestionObject (15)
getQuestionObject (16)
createAnswerObject (17)
updateAnswerObject (18)
deleteAnswerObject (19)
getAnswerObject (20)
getAllAnswers (21)
getUnitBooks (22)
setActive (23)
getOpenUnits (24)
getClosedUnits (25)
getAllUnits (26)
createUnitObject (27)
updateUnitObject($unitObjectIn) (28)
getUnitObject (29)
deleteUnitObject (30)
getSuperUnitObject (31)
getAllSuperUnits (32)
reportActivity (33)

createBookObject

Author: Brad
Version: 04.20.05

Example

dblibraryBookObject::createBookObject($bookObjectIn)

Parameters

BookObjectInBookObject to be stored in the book table

Returns

Returns a bookObject with the primary key as the id and information provided by the parameter


Top

updateBookObject

Author: Brad
Version: 04.20.05

Example

dblibraryBookObject::updateBookObject($bookObjectIn)

Parameters

BookObjectInBookObject to be updated in the book table

Returns

Boolean: true if updated without errors, false if update failed


Top

deleteBookObject

Author: Brad
Version: 03.23.05

Example

dblibraryBookObject::deleteBookObject($bookObjectIn)

Parameters

BookObjectInBookObject to be deleted in the book table (just uses the book id)

Returns

Boolean: true if the book object deleted, false if it failed to delete


Top

getBookObject

Author: Brad
Version: 04.20.05

Example

dblibraryBookObject::getBookObject($idIn)

Parameters

IdInP_key (id) of the book to get from the book table

Returns

BookObject if the object is found in the database, -1 if not found


Top

getBookPages

Author: Brad
Version: 03.23.05

Example

dblibraryBookObject::getBookPages($idIn)

Parameters

IdInThe id of the book

Returns

An array of page elements in the order they would appear in the book


Top

createPageObject

Author: Brad
Version: 03.23.05

Example

dblibraryBookObject::createPageObject($pageObjectIn)

Parameters

PageObjectInPageObject to be stored in the page table

Returns

PageObject with the primary key as the id, and other fields the same as the input object


Top

updatePageObject

Author: Brad
Version: 03.23.05

Example

dblibraryBookObject::updatePageObject($pageObjectIn)

Parameters

PageObjectInPageObject to be updated in the page table

Returns

Boolean: true if the object updated, false if there was an error during update


Top

deletePageObject

Author: Brad
Version: 03.23.05

Example

dblibraryBookObject::deletePageObject($pageObjectIn)

Parameters

PageObjectInPageObject to be deleted in the page table

Returns

Boolean: true if the object deleted, false if there was an error during the delte


Top

getPageObject

Author: Brad
Version: 03.23.05

Example

dblibraryBookObject::getPageObject($idIn)

Parameters

IdInP_key (id) of the page in the page table

Returns

PageObject equivalent to the entry in the database, -1 if the object was not found


Top

pageHasQuestion

Author: Brad
Version: 04.20.05

Example

dblibraryBookObject::pageHasQuestion($pageIn)

Parameters

PageInP_key (id) of page

Returns

True if page contains a question, false otherwise


Top

getQuestionObjectFromPage

Author: Brad
Version: 04.12.05

Example

dblibraryBookObject::getQuestionObjectFromPage($-)

Parameters

-PageIn page object we want question for

Returns

Boolean: questionObject of the question if found, else -1


Top

createQuestionObject

Author: Brad
Version: 04.25.05

Example

dblibraryBookObject::createQuestionObject($questionObjectIn)

Parameters

QuestionObjectInQuestionObject to be created in the database

Top

updateQuestionObject

Author: Brad
Version: 03.23.05

Example

dblibraryBookObject::updateQuestionObject($questionObjectIn)

Parameters

QuestionObjectInQuestionObject to be updated in the question table

Returns

Boolean: returns true if updated, false if not


Top

deleteQuestionObject

Author: Brad
Version: 03.23.05

Example

dblibraryBookObject::deleteQuestionObject($questionObjectIn)

Parameters

QuestionObjectInQuestionObject to be deleted from the question table

Returns

Boolean: returns true if deleted, false if not


Top

getQuestionObject

Author: Brad
Version: 03.23.05

Example

dblibraryBookObject::getQuestionObject($idIn)

Parameters

IdInP_key (id) of the question in the question table

Returns

Returns a questionObject equivalent to the entry in the database, -1 if not found


Top

createAnswerObject

Author: Brad
Version: 03.23.05

Example

dblibraryBookObject::createAnswerObject($answerObjectIn)

Parameters

AnswerObjectInAnswerObject to be stored in the question_answer table

Returns

Returns an answerObject equivalent to the entry added to the database


Top

updateAnswerObject

Author: Brad
Version: 03.23.05

Example

dblibraryBookObject::updateAnswerObject($answerObjectIn)

Parameters

AnswerObjectInAnswerObject to be updated in the question_answer table

Returns

Boolean: returns true if updated, false if not


Top

deleteAnswerObject

Author: Brad
Version: 03.23.05

Example

dblibraryBookObject::deleteAnswerObject($answerObjectIn)

Parameters

AnswerObjectInAnswerObject to be deleted from the question_answer table

Returns

Boolean: returns true if deleted, false if not


Top

getAnswerObject

Author: Brad
Version: 03.23.05

Example

dblibraryBookObject::getAnswerObject($idIn)

Parameters

IdInP_key (id) of the entry in the question_answer table to get

Returns

Returns an answerObject if found, or -1 if not


Top

getAllAnswers

Author: David
Version: 04.12.05

Example

dblibraryBookObject::getAllAnswers($idIn)

Parameters

IdInP_key (id) of question we need answers for

Returns

Returns an array of answerObjects


Top

getUnitBooks

Author: David
Version: 04.20.05

Description

Returns an array of books contained within specified unit -- if $activeOnly == true, returnsonly that unit's active books.

Example

dblibraryBookObject::getUnitBooks($idIn, $activeOnly)

Parameters

IdInP_key (id) of unit we need books for
ActiveOnlyBool (0 or 1) to indicate if want only active books (1) or all books (0)

Returns

Returns an array of bookObjects


Top

setActive

Author: David
Version: 04.20.05

Description

Sets a book to be active within its unit.

Example

dblibraryBookObject::setActive($uid, $bookids)

Parameters

UidP_key of unit
BookidsArray of bookids to be set to active

Top

getOpenUnits

Author: David
Version: 04.11.05

Description

Returns an array of unitObjects containing less than eight books -- this should be a legacyfunction and should not be used.

Example

dblibraryBookObject::getOpenUnits()

Parameters

None

Returns

Returns an array containing unitObjects for all open units (<8 books)


Top

getClosedUnits

Author: David
Version: 04.11.05

Description

Returns an array of unitObjects containing units that currently have 8 active books.

Example

dblibraryBookObject::getClosedUnits()

Parameters

None

Returns

Returns an array containing unitObjects for all closed units (==8 books)


Top

getAllUnits

Author: David
Version: 04.11.05

Description

Returns an array of unitObjects for all units in the database.

Example

dblibraryBookObject::getAllUnits()

Parameters

None

Returns

Returns an array containing unitObjects for all units


Top

createUnitObject

Author: David
Version: 04.11.05

Description

Creates a unit in the database.

Example

dblibraryBookObject::createUnitObject($-)

Parameters

-UnitObjectIn unit object to be stored in the unit table

Returns

Returns book object with id filled in


Top

updateUnitObject($unitObjectIn)

Author: David
Version: 04.20.05

Description

Updates unit in the database that has unitObjectIn's p_key.

Example

dblibraryBookObject::updateUnitObject($unitObjectIn)($-)

Parameters

-UnitObjectIn unit object with updated information

Returns

Returns true if update successful, false otherwise


Top

getUnitObject

Author: David
Version: 03.29.05

Description

Retrieves unit object with idIn as its p_key from the database.

Example

dblibraryBookObject::getUnitObject($idIn)

Parameters

IdInP_key (id) of unit we need object for

Returns

Returns a unit object for the specified p_key, -1 if not found


Top

deleteUnitObject

Author: David
Version: 04.21.05

Description

Deletes unit object with p_key = idIn from db.

Example

dblibraryBookObject::deleteUnitObject($idIn)

Parameters

IdInP_key (id) of unit to be deleted

Returns

Returns true if succesfully deleted, false otherwise


Top

getSuperUnitObject

Author: David
Version: 04.21.05

Description

Gets SuperUnitObject with p_key=idIn from db.

Example

dblibraryBookObject::getSuperUnitObject($idIn)

Parameters

IdInP_key (id) of superunit we need for

Returns

Returns superUnitObject of entry if found, -1 otherwise


Top

getAllSuperUnits

Author: David
Version: 04.21.05

Description

Retrieves an array of all superunits from the db.

Example

dblibraryBookObject::getAllSuperUnits()

Parameters

None

Returns

Returns an array of all super units in superUnitObjects


Top

reportActivity

Author: David
Version: 03.29.05

Description

Creates an entry in 'student_activity' table recording student_id, book_id and time read-- called from typeSelect.php when reading (not when previewing).

Example

dblibraryBookObject::reportActivity($bookIDIn, $studentIDIn)

Parameters

BookIDInP_key (id) of book being accessed
StudentIDInP_key (id) of student accessing the book

Returns

Returns id of row created by insertion


Top