Public Member Functions | |
__construct ($id= '') | |
Initializes new Chapter object. | |
addSection ($name, $description= '') | |
Creates a new section in this chapter. | |
deleteSectionByName ($name) | |
Deletes any child sections with given name. | |
getIdentifier () | |
Returns a string that identifies this chapter. | |
getParent () | |
Retrieves the book object to which this chapter belongs. | |
isValid () | |
Determines whether chapter is valid to be in the database. | |
listChildren ($constraints=array(), $limit=array(), $order=array(), $cnt=false, $withAlCnt=false) | |
Returns a list of all sections contained in this chapter, constrained by given criteria. | |
listValidChildren ($constraints=array(), $limit=array(), $order=array(), $cnt=false) | |
INSERT BRIEF DESCRIPTION HERE. | |
Static Public Member Functions | |
static | getList ($constraints=array(), $limit=array(), $order=array(), $cnt=false) |
Returns a list of all chapters, constrained by given criteria. |
A chapter contains one or more sections. It belongs to one and only one book. This class has methods for creating, destroying and querying chapters.
Attributes:
id
[int]: ID of chapter (-)name
[string]: name of chapter (edit)bookId
[int]: ID of book to which this chapter belogs (-) TSDChapter::__construct | ( | $ | id = '' |
) |
Initializes new Chapter object.
If $id
is provided, then an attempt is made to populate this object from the database using that ID. Otherwise, an empty object is created, which can be filled with new data to be committed later. You cannot populate after creating the object.
$id | [int]: ID of chapter in database to populate from |
TSDChapter::addSection | ( | $ | name, | |
$ | description = '' | |||
) |
Creates a new section in this chapter.
You must have the edit permission to add new chapters.
$name | [string]: name of section | |
$description | [string]: optional description for section |
TSDChapter::deleteSectionByName | ( | $ | name | ) |
Deletes any child sections with given name.
This will only delete sections that belong to this book and only if the name matches exactly (but case insensitive).
$name | [string]: name of section(s) to delete |
TSDChapter::getIdentifier | ( | ) |
Returns a string that identifies this chapter.
The identifier string is not meant to uniquely identify the chapter, but rather for use for display purposes. For chapters, the identifier is simply the name of the chapter.
static TSDChapter::getList | ( | $ | constraints = array() , |
|
$ | limit = array() , |
|||
$ | order = array() , |
|||
$ | cnt = false | |||
) | [static] |
Returns a list of all chapters, constrained by given criteria.
See Guide to Database Constraints for more about how to constraint the resultset. You can also request that the number of results be returned, rather than the results themselves.
$constraints | [array]: additional constraints on the result set | |
$limit | [array]: parameters for the LIMIT clause of the query | |
$order | [array]: how to order the results | |
$cnt | [boolean]: whether to return the number of results (if true) or the results themselves (if false, the default) |
$cnt
== true), or null if there was an error TSDChapter::getParent | ( | ) |
TSDChapter::isValid | ( | ) |
TSDChapter::listChildren | ( | $ | constraints = array() , |
|
$ | limit = array() , |
|||
$ | order = array() , |
|||
$ | cnt = false , |
|||
$ | withAlCnt = false | |||
) |
Returns a list of all sections contained in this chapter, constrained by given criteria.
See Guide to Database Constraints for more about how to constraint the resultset. You can also request that the number of results be returned, rather than the results themselves.
Only sections that belong to this book will be returned, although it is theoretically possible to circumvent this with the constraints array. With no arguments, an array of TSDsEction objects is returned, all of which belong to this chapter object.
$constraints | [array]: additional constraints on the result set | |
$limit | [array]: parameters for the LIMIT clause of the query | |
$order | [array]: how to order the results | |
$cnt | [boolean]: whether to return the number of results (if true) or the results themselves (if false, the default) | |
$withAlCnt | [boolean]: if true, also include a field in each result object that indicates how many alignments there are (field will be called 'numAlignments') |
$cnt
== true), or null if there was an error TSDChapter::listValidChildren | ( | $ | constraints = array() , |
|
$ | limit = array() , |
|||
$ | order = array() , |
|||
$ | cnt = false | |||
) |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
$constraints | [TYPE]: DESCRIPTION | |
$limit | [TYPE]: DESCRIPTION | |
$order | [TYPE]: DESCRIPTION | |
$cnt | [TYPE]: DESCRIPTION |