TSDStandardGrade Class Reference
[Standards Hierarchy Objects]

Represents grade band in TSD standards hierarchy. More...

Inheritance diagram for TSDStandardGrade:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 __construct ($id= '')
 Constructs new grade object.
 addCategory ($name)
 Creates a new TSDStandardCategory object that belongs to this grade.
 deleteCategoryByName ($name)
 Removes all categories that have the given name.
 getIdentifier ()
 Returns string meant to be used when displaying the grade band.
 getParent ()
 Retrieves parent organization.
 isValid ()
 Returns whether grade is valid to be in the database.
 listChildren ($constraints=array(), $limit=array(), $order=array(), $cnt=false)
 Retrieves list of child (TSDStandardCategory) objects.
 listValidChildren ($constraints=array(), $limit=array(), $order=array(), $cnt=false)
 Retreives list of child (TSDStandardCategory) objects that have a full hierarchy beneath them.

Static Public Member Functions

static getList ($constraints=array(), $limit=array(), $order=array(), $cnt=false)
 Retrieves list of TSDStandardGrade objects according to constraints specified.


Detailed Description

Represents grade band in TSD standards hierarchy.

A grade band contains one or more categories (TSDStandardCategory). The grade band has a name and it belongs to exactly one organization (TSDStandardOrganization). The categories contain objectives, which are the leaves of the standards hierarchy.

Attributes:


Constructor & Destructor Documentation

TSDStandardGrade::__construct ( id = ''  ) 

Constructs new grade object.

Parameters:
$id [int]: ID of existing grade band if this object is to be populated from the database


Member Function Documentation

TSDStandardGrade::addCategory ( name  ) 

Creates a new TSDStandardCategory object that belongs to this grade.

You must have the 'edit' permission to be able to create new category objects

Parameters:
$name [string]: name of new category
Returns:
[TSDStandardCategory]: new TSDStandardCategory object, or null if there was an error

TSDStandardGrade::deleteCategoryByName ( name  ) 

Removes all categories that have the given name.

You must have the 'edit' permission to delete categories.

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

TSDStandardGrade::getIdentifier (  ) 

Returns string meant to be used when displaying the grade band.

This string is not guaranteed to be unique, but is considered to be a good enough display name. Currently, it is simply the value of the 'name' field.

Returns:
[string]: display string

static TSDStandardGrade::getList ( constraints = array(),
limit = array(),
order = array(),
cnt = false 
) [static]

Retrieves list of TSDStandardGrade objects according to constraints specified.

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]: resultset constraints
$limit [array]: limit the number of results
$order [array]: how the results are ordered
$cnt [boolean]: if true, just returns a count of how many objects would be returned, otherwise, actually returns array of objects
Returns:
[array]: array of TSDStandardGrade objects, or an integer if $cnt is true, or null if there was an error

TSDStandardGrade::getParent (  ) 

Retrieves parent organization.

Returns:
[TSDStandardOrganization]: organization that contains this grade band, or null on error

TSDStandardGrade::isValid (  ) 

Returns whether grade is valid to be in the database.

A grade is valid if it has an empty ID, or a >0 numeric ID. It must also have a non-empty string name an a >0 numeric organization ID.

Returns:
[boolean]: whether grade is valid according to above criteria

TSDStandardGrade::listChildren ( constraints = array(),
limit = array(),
order = array(),
cnt = false 
)

Retrieves list of child (TSDStandardCategory) objects.

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]: constraint resultset
$limit [array]: limit the number of results returned
$order [array]: how the results are ordered
$cnt [boolean]: if true, return the number of result objects that would be returned; if false, return the objects in an array
Returns:
[array]: array of TSDStandardCategory objects that belong to this grade band, or an integer with the number of objects that would be returned (if $cnt is true) or null if there was an error

TSDStandardGrade::listValidChildren ( constraints = array(),
limit = array(),
order = array(),
cnt = false 
)

Retreives list of child (TSDStandardCategory) objects that have a full hierarchy beneath them.

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. Valid children are those subtrees (categories) that have children that are themselves valid. For a subtree to be completely valid, every leaf node must be an Objective. That is, there cannot be, say, Categories that have no Objectives.

Parameters:
$constraints [array]: constraint resultset
$limit [array]: limit the number of results returned
$order [array]: how the results are ordered
$cnt [boolean]: if true, return the number of result objects that would be returned; if false, return the objects in an array
Returns:
[array]: array of TSDStandardGrade objects that belong to this organization, or an integer with the number of objects that would be returned (if $cnt is true) or null if there was an error


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

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