TSDChapter Class Reference
[Textbook Hierarchy Objects]

Represents a "Chapter" in the TSD textbook hierarchy. More...

Inheritance diagram for TSDChapter:

Inheritance graph
[legend]

List of all members.

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.


Detailed Description

Represents a "Chapter" in the TSD textbook hierarchy.

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:


Constructor & Destructor Documentation

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.

Parameters:
$id [int]: ID of chapter in database to populate from


Member Function Documentation

TSDChapter::addSection ( name,
description = '' 
)

Creates a new section in this chapter.

You must have the edit permission to add new chapters.

Parameters:
$name [string]: name of section
$description [string]: optional description for section
Returns:
[TSDSection]: new section object, or null if there was an error

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).

Parameters:
$name [string]: name of section(s) to delete
Returns:
[boolean]: success or failure

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.

Returns:
[string]: identifier for 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.

Parameters:
$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)
Returns:
[array]: array of TSDChapter, if any, or an integer specifying the number of results that would have been returned (if $cnt == true), or null if there was an error

TSDChapter::getParent (  ) 

Retrieves the book object to which this chapter belongs.

Returns:
[TSDBook]: parent book

TSDChapter::isValid (  ) 

Determines whether chapter is valid to be in the database.

A chapter is valid if it has an empty id or the id is an integer greater than zero. It must also have a non-empty string value for its name and an integer greater than zero for bookId.

Returns:
[boolean]: whether chapter object is valid

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.

Parameters:
$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')
Returns:
[array]: array of TSDSection, if any, or an integer specifying the number of results that would have been returned (if $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

Parameters:
$constraints [TYPE]: DESCRIPTION
$limit [TYPE]: DESCRIPTION
$order [TYPE]: DESCRIPTION
$cnt [TYPE]: DESCRIPTION
Returns:
[TYPE]: RETURN DESCRIPTION


The documentation for this class was generated from the following file:

Generated on Wed Nov 24 02:04:54 2010 for Common by  doxygen 1.5.6