The Project class represents a project, generally one taken on by a team within an organization. Attributes include project name, containing project space, starting and projected and actual completion dates, lead and optional co-lead, and containers for team members, basic accounting attributes, milestones, and deliverables.
Project Project (int project_space_guid, string name, string description, int lead [, int co_lead [, array start_date [, array projected_finish [, array finish_date)] ] ] ])
Used to create a new Project object. Before contained objects can be associated
with the new project, it must be saved by calling project_object->save().
Note: This method should only be used to create a new Project. To access an existing Project
object, use Project::get_by_project_id().
Project get_by_project_id (int project_id)
void load_containers ()
void save ()
int get_project_id ()
string get_project_name ()
void change_project_name (string new_project_name)
int get_project_lead ()
void change_project_lead (int new_lead_id)
int get_project_co_lead ()
void set_project_co_lead (int new_co_lead_id)
text get_project_description ()
void change_project_description (text new_description)
array get_start_date ()
void set_start_date (array start_date)
array get_projected_finish ()
void set_projected_finish (array projected_finish)
array get_finish_date ()
void set_finish_date (array finish_date)
boolean is_modified ()
array as_array ()
string to_string ()
string to_HTML_string ()
array get_participants ()
array get_allocations ()
array get_expenditures ()
array get_milestones ()
array get_deliverables ()
Loads all container attributes of the Project object. The following containers will be loaded: task headers, participants, allocations, expenditures, milestones, and deliverables. These containers can then be accessed by calling the related accessor methods
Note: This method should not be called on a newly-created Project object until that object has been saved by calling project_object->save().
This method should be called to save either a newly created Project object, or one that has been modified. Most operations on a newly-created object will required that it be saved before use. Returns 1 on success, or an array with keys "error" and "rows affected" on failure.
Returns the unique ID for the project. This GUID can then be used when accessing to the project. Returns NULL if project has not been saved.
Returns the name of the Project object.
Changes the name of the current Project object to project_name.
Returns the unique ID of the Person assigned as lead fo the current project.
Changes the project lead to the person whose unique ID is new_lead_id
Returns the unique ID of the Person assigned as co-lead fo the current project.
Assigns the person whose unigue ID is new_co_lead_id as the co-lead on the current project
Returns the description text for the current project.
Changes the description text of the current project to the text provided by new_description
Returns an associative array with keys 'year', 'month', and 'day' if the start date for the current project has been set. Othewise returns an empty array.
Sets or changes the start date for the current project to the value given by start_date.
Returns an associative array with keys 'year', 'month', and 'day' if the projected finish date for the current project has been set. Othewise returns an empty array.
Sets or changes the projected finish date for the current project to the value given by projected_finish.
Returns an associative array with keys 'year', 'month', and 'day' if the actual completion date for the current project has been set. Othewise returns an empty array.
Records the completion of the project or task by setting the finish date to the value given by finish_date.
Returns true if the Project object has been newly created and not saved, or if it has been modified since it was loaded.
Returns an associative array with keys:
Mandatory: project_name, description, lead
Optional: co_lead, start_date, projected_finish, finish_date
Collections: participants, task_ids, expenditures, allocations, milestones, deliverables.
If optional keys have not been set, they will not be defined in the returned array. Collection keys will contain empty arrays if corresponding collections have not yet been loaded, or are empty.
Returns a plain-text string describing the current Project object. May be used for debugging when printng to a log file or console.
Returns an HTML-formatted string describing the current project object. May be used for debugging directly to the browser.
The following methods provide access to collections of objects related to the current project. These include Person objects for participants, Allocation and Expenditure objects for budget items specifically tied to the current project, and Milestone and Deliverable objects used as progress indicators for the project.
In this version of the Project Manager API, no methods for creating these objects are provided within the Project class. Each of these classes has its own constructor, which takes a project_id argument. These constructors may be called when creating new objects. The ProjectManager class also provides methods for creating each type of object and associating it with a specific Project object.
Returns an array containing Person objects corresponding to each person currently listed as a participant in the current project.
Returns an array containing Allocation objects for all allocations specified directly for use on the current project.
Returns an array containing Expenditure objects for all expenditures billed directly to the current project.
Returns an array containing Milestone objects for all milestones set or achieved that relate directly to the current project.
Returns an array containing Deliverable objects for all deliverables specified directly for the current project.
class OtherClass