phpDocumentor KuoteObjects
Enrollment
[ class tree: KuoteObjects ] [ index: KuoteObjects ] [ all elements ]

Class: KuoteObjects_Enrollment

Source Location: /classes/KuoteObjects/Enrollment.php

Class KuoteObjects_Enrollment

Class Overview

Implements interfaces:

KuoteObjects Enrollment

The KuoteObjects Enrollment represents a student having enrolled in a course offering in the Kuote system. It must implement the interfaces KuoteInterfaces_Object, and KuoteInterfaces_Enrollment

Located in /classes/KuoteObjects/Enrollment.php [line 20]



		
				Author(s):
		
  • Kyle Hall
Information Tags:
Copyright:  2006

Properties

Methods

[ Top ]
Property Summary
mixed   $enrollment   Private variable to contain a DB_DataObjects object derived from MySQL or another DB.

[ Top ]
Method Summary
static boolean   enroll()   Creates a new enrollment for the given User Id and Course Offering Id.
KuoteObjects_Enrollment   __construct()   Constructor instantiates $enrollment as a DataObjects_Enrollment object.
boolean   delete()   Removes the object from the datastore based on it's Id
boolean   get()   Loads the object from the data store by its unique identifier.
boolean   getByUserAndCourseOffering()   In theory, every combination of User Id and Course Offering Id should be unique.
integer   getCourseOfferingId()   Returns the id of the Course Offering for this enrollment.
integer   getGrade()   Returns the current grade for this enrollment.
integer   getId()   Returns the unique id of the object
integer   getUserId()   Returns the id of the User for this enrollment.
boolean   insert()   Takes the currently set properties of the object and inserts them into the data store as a new instance with its own unique id.
boolean   setCourseOfferingId()   Sets the id of the Course Offering for this enrollment.
boolean   setGrade()   Sets the current grade for this enrollment.
boolean   setUserId()   Sets the id of the User for this enrollment.
boolean   update()   Updates the datastore to reflect the currently set properties of the object.

[ Top ]
Properties
mixed   $enrollment [line 26]

Private variable to contain a DB_DataObjects object derived from MySQL or another DB.

API Tags:
Access:  protected


[ Top ]
Methods
static method enroll  [line 180]

  static boolean enroll( integer $userId, integer $courseOfferingId  )

Creates a new enrollment for the given User Id and Course Offering Id.

Parameters:
integer   $userId:  The id of the User.
integer   $courseOfferingId:  The id of the Course Offering the user is to enroll in.

API Tags:
Return:  True on successful set, false otherwise.
Access:  public

Information Tags:
Throws:  Exception 2 on failure.
Throws:  Exception 3 if already enrolled.

[ Top ]
Constructor __construct  [line 32]

  KuoteObjects_Enrollment __construct( )

Constructor instantiates $enrollment as a DataObjects_Enrollment object.


API Tags:
Access:  public

Information Tags:
Link:  http://pear.php.net/package/DB_DataObject/

[ Top ]
delete  [line 71]

  boolean delete( )

Removes the object from the datastore based on it's Id


API Tags:
Return:  True on success, false otherwise.
Access:  public


[ Top ]
get  [line 42]

  boolean get( integer $id  )

Loads the object from the data store by its unique identifier.

Parameters:
integer   $id:  Unique identifier of a course in the data store.

API Tags:
Return:  True on success, false otherwise.
Access:  public


[ Top ]
getByUserAndCourseOffering  [line 94]

  boolean getByUserAndCourseOffering( KuoteObjects_User $user, KuoteObjects_CourseOffering $courseOffering  )

In theory, every combination of User Id and Course Offering Id should be unique.

This method loads into the object this first intance of a 'row' containing both values.

Parameters:
KuoteObjects_User   $user:  This user to look up.
KuoteObjects_CourseOffering   $courseOffering:  The course offering to look up.

API Tags:
Return:  True on success.
Access:  public

Information Tags:
Throws:  Exception 1 if no enrollment found.

[ Top ]
getCourseOfferingId  [line 156]

  integer getCourseOfferingId( )

Returns the id of the Course Offering for this enrollment.


API Tags:
Return:  Course Offering Id.
Access:  public


[ Top ]
getGrade  [line 118]

  integer getGrade( )

Returns the current grade for this enrollment.


API Tags:
Return:  Grade as a percentage.
Access:  public


[ Top ]
getId  [line 80]

  integer getId( )

Returns the unique id of the object


API Tags:
Return:  The objects's unique id
Access:  public


[ Top ]
getUserId  [line 137]

  integer getUserId( )

Returns the id of the User for this enrollment.


API Tags:
Return:  User Id.
Access:  public


[ Top ]
insert  [line 52]

  boolean insert( )

Takes the currently set properties of the object and inserts them into the data store as a new instance with its own unique id.


API Tags:
Return:  True on success, false otherwise.
Access:  public


[ Top ]
setCourseOfferingId  [line 166]

  boolean setCourseOfferingId( integer $id  )

Sets the id of the Course Offering for this enrollment.

Parameters:
integer   $id:  The Course Offering Id.

API Tags:
Return:  True on successful set, false otherwise.
Access:  public


[ Top ]
setGrade  [line 128]

  boolean setGrade( integer $grade  )

Sets the current grade for this enrollment.

Parameters:
integer   $grade:  The grade as a percentage.

API Tags:
Return:  True on successful set, false otherwise.
Access:  public


[ Top ]
setUserId  [line 147]

  boolean setUserId( integer $id  )

Sets the id of the User for this enrollment.

Parameters:
integer   $id:  The User Id.

API Tags:
Return:  True on successful set, false otherwise.
Access:  public


[ Top ]
update  [line 62]

  boolean update( )

Updates the datastore to reflect the currently set properties of the object.

Updates by the current Id.


API Tags:
Return:  True on success, false otherwise.
Access:  public


[ Top ]

Documentation generated on Fri, 15 Dec 2006 11:17:29 -0500 by phpDocumentor 1.3.0