Project::Project()

Description

Project Project (int project_space_guid, string name, text description, int lead [, int co_lead [, array start_date [, array projected_finish [, array finish_date] ] ] ])

Throws:

Exception model pending...

Description of method and its purpose.

Parameters

int project_space_guid required

Size:: integer

This is the unique ID of the project space in which the new Project object will be created. If no project spaces have been defined, or if only a single default project space is used within a system, this can safely be set to the default value 0.

string name required

Size:: maximum 64 characters

A name for the project. This should be a meaningful and human-readable expression. It is also advisable, though not manadatory that this be unique, at least within the current project space.

text description required

Size:: no limit

A description of the project.

int lead required

Size:: integer

The unique ID of the Person object corresponding to the project lead. [A Person object must be created for the lead before any Project can be created]

int co_lead optional

Size:: integer

The unique ID of the co-lead, if any, for the project.

array start_date optional

Size:: 3-element asscociative array

The date on which work on the project begins. This parameter takes an associative array with keys 'year', 'month', and 'day'. The value of 'year' MUST be a full, four-digit year designation. The 'month' and 'day' values MUST be numeric.

array projected_finish optional

Size:: 3-element asscociative array

The projected completion date for the project. This value is intended for use during planning and implementation phases, and to measure actual preformance against projections. This parameter takes an associative array with keys 'year', 'month', and 'day'. The value of 'year' MUST be a full, four-digit year designation. The 'month' and 'day' values MUST be numeric.

array finish_date optional

Size:: 3-element asscociative array

The actual completion date for the project. This value is not intended for use during planning and implementation phases. Under no circumstances, no argument should be offered to this parameter, but it may be used in recording historical information, or when a system is first ported into the Project Manager API . This parameter takes an associative array with keys 'year', 'month', and 'day'. The value of 'year' MUST be a full, four-digit year designation. The 'month' and 'day' values MUST be numeric.

Return Values

Project

This constructor returns a new Project object. The properties included in the constructor may be modified at any time by calling the appropriate accessor methods. The object returned does not have a unique ID, though. Therefore, before attempting to add any items to its collection attributes [participants, allocations, expenditures, milestones, or deliverables] this object should be saved by calling $project-object->save().

Example

From implementation of ProjectSpace::add_project():

<?php
      ...
      $guid = $this->_project_space_guid;
      $project = new Project($guid, $name, $description, $lead, $co_lead,
       $projected_finish, $finish_date);
      $project->save();
      $project_id = $project->get_project_id();
      return $project;
   }
?>
   

See Also:

class ClassName
Related Topic