Helix Installation   Getting Started   Reference Documentation   Global Functions   Quick Start
ModulesClassesFunctions
 

Class Reference

class prospect extends prospect_ext

Hide Inherited MembersProject Management
Description
No description.
 
Constants
constantTABLENAME ["prj_prospect"][ prospect ]
 
Properties
protected_cdate[ prospect_db ]
protected_cdate_dirty[ prospect_db ]
protected_code[ projectentity_db ]
protected_code_dirty[ projectentity_db ]
protected_deleted[ prospect_db ]
protected_deleted_dirty[ prospect_db ]
protected_description[ projectentity_db ]
protected_description_dirty[ projectentity_db ]
protected_dirty[ obj ]
protected__id[ prospect_db ]
protected_id[ projectentity_db ]
protected_id_dirty[ projectentity_db ]
protected__id_dirty[ prospect_db ]
protected_mdate[ prospect_db ]
protected_mdate_dirty[ prospect_db ]
protected_name[ projectentity_db ]
protected_name_dirty[ projectentity_db ]
protected_projectentity_id[ prospect_db ]
protected_projectentity_id_dirty[ prospect_db ]
protected_projectentitystatus_id[ projectentity_db ]
protected_projectentitystatus_id_dirty[ projectentity_db ]
publicproperty_objects_array[ obj ]
 
Methods
publiccommit ( )[ prospect_db ]
Parameters
No parameters for this method
Code
104  public function commit()
105  {
106      if ($this->_projectentity_id > 0)
107      {
108          $this->update();
109      }
110      else
111      {
112          $this->insert();
113      }
114 
115      foreach ($this->property_objects_array as $property=>$object)
116      {
117          $this->{$property} = $object;
118      }
119 
120      return true;
121  }
public__construct ( projectentity_id , name , code )[ prospect_db ]
Parameters
optionalprojectentity_id
optionalname
optionalcode
Code
040  public function __construct($__projectentity_id=null, $__name=null, $__code=null)
041  {
042      $this->__id = 0;
043      $this->_projectentity_id = 0;
044      $this->_mdate = null;
045      $this->_cdate = null;
046      $this->_deleted = false;
047      $this->_id = 0;
048      $this->_name = "";
049      $this->_code = "";
050      $this->_description = "";
051      $this->_projectentitystatus_id = 0;
052 
053      $this->__id_dirty = false;
054      $this->_projectentity_id_dirty = false;
055      $this->_mdate_dirty = false;
056      $this->_cdate_dirty = false;
057      $this->_deleted_dirty = false;
058      $this->_id_dirty = false;
059      $this->_name_dirty = false;
060      $this->_code_dirty = false;
061      $this->_description_dirty = false;
062      $this->_projectentitystatus_id_dirty = false;
063 
064      if (is_null($__projectentity_id) && is_null($__name) && is_null($__code))
065      {
066          return;
067      }
068 
069      $db = prospect::db();
070      $q  = " SELECT prj_projectentity.id,prj_projectentity.name,prj_projectentity.code,prj_projectentity.description,prj_projectentity.projectentitystatus_id,prj_prospect._id,prj_prospect.projectentity_id,prj_prospect.mdate,prj_prospect.cdate,prj_prospect.deleted ";
071      $q .= " FROM prj_prospect ";
072      $q .= " INNER JOIN prj_projectentity ON prj_prospect.projectentity_id=prj_projectentity.id ";
073      $q .= is_null($__projectentity_id) ? "" : " AND prj_projectentity.id='$__projectentity_id' ";
074      $q .= is_null($__name) ? "" : " AND prj_projectentity.name='$__name' ";
075      $q .= is_null($__code) ? "" : " AND prj_projectentity.code='$__code' ";       
076 
077      $db->query($q);
078      if ($db->next_record() && $db->num_rows() == 1)
079      {
080          $this->_id = $db->f("id");
081          $this->_name = $db->f("name");
082          $this->_code = $db->f("code");
083          $this->_description = $db->f("description");
084          $this->_projectentitystatus_id = $db->f("projectentitystatus_id");
085          $this->__id = $db->f("_id");
086          $this->_projectentity_id = $db->f("projectentity_id");
087          $this->_mdate = $db->f("mdate");
088          $this->_cdate = $db->f("cdate");
089          $this->_deleted = $db->f("deleted");
090      }
091  }
protected staticdb ( )[ prospect_db ]
Parameters
No parameters for this method
Code
343  protected static function db()
344  {
345      return new db();
346  }
publicdelete ( )[ prospect_db ]
Parameters
No parameters for this method
Code
156  public function delete()
157  {
158      parent::delete();
159      $db = prospect::db();
160      $q  = " UPDATE prj_prospect SET ";
161      $q .= " deleted = 1 ";
162      $q .= " WHERE projectentity_id = " . $this->_projectentity_id;
163      $db->query($q);
164      $this->deleted = true;
165      return true;
166  }
public staticdelete_all ( )[ prospect_db ]
Parameters
No parameters for this method
Code
267  public static function delete_all()
268  {
269      $db = prospect::db();
270      $q  = " UPDATE prj_prospect SET ";
271      $q .= " deleted = 1 ";
272     
273      $db->query($q);
274      return true;
275  }
public__get ( p )[ obj ]
Parameters
requiredp
Code
007  public function __get($p)
008  {
009      $methods = get_class_methods($this);
010      $properties = get_object_vars($this);
011      if (in_array("get_$p",$methods))
012      {
013          return $this->{"get_$p"}();
014      }
015      else if (array_key_exists("_$p",$properties))
016      {
017          return $this->{"_$p"};
018      }
019      else if (in_array("get_" . substr($p,strpos($p,"_")+1), $methods))
020      {
021          return $this->{"get_" . substr($p,strpos($p,"_")+1)}(substr($p,0,strpos($p,"_")));
022      }
023      else
024      {
025          trigger_error("This object [" . get_class($this) . ":$this->id] has no private property '_$p' for the requested public property '$p'",E_USER_WARNING);
026          return null;
027      }
028  }
publicget_array ( )[ obj ]
Parameters
No parameters for this method
Code
096  public function get_array()
097  {
098      return get_object_vars($this);
099  }
publicget_budget ( type ["default"] )[ projectentity_db ]
Parameters
optionaltype ["default"]
Code
948  public function get_budget($__type="default")
949  {
950      $object = is_null(keyval($this->property_objects_array,"{$__type}_budget")) ? new budget($this->get_budget_id($__type)) : $this->property_objects_array["{$__type}_budget"];
951      $this->property_objects_array["{$__type}_budget"] = $object;
952      return $object;
953  }
publicget_budget_id ( type ["default"] )[ projectentity_db ]
Parameters
optionaltype ["default"]
Code
954  public function get_budget_id($__type="default")
955  {
956      $ids = $this->get_budget_ids($__type, true);
957      return (count($ids)==1 ? $ids[0] : null);
958  }
publicget_budget_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ projectentity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
959  public function get_budget_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
960  {
961      $budget_ids = array();
962      $db = projectentity::db();
963      $q  = " SELECT fa_budget.id FROM prj_budget_projectentity INNER JOIN fa_budget ON prj_budget_projectentity.budget_id=fa_budget.id AND prj_budget_projectentity.deleted=0 AND fa_budget.deleted=0 AND prj_budget_projectentity.projectentity_id='$this->id' " . (is_null($__type) ? "" : " AND prj_budget_projectentity.budget_projectentity_type_id='" . budget_projectentity::type_id($__type) . "'") . ($__get_primary ? " AND prj_budget_projectentity.primary=1 " : "");
964      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
965      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
966      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
967      $db->query($q);
968      while ($db->next_record())
969      {
970          $budget_ids[] = $db->f("id");
971      }
972      return $budget_ids;
973  }
publicget_budget_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ projectentity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
974  public function get_budget_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
975  {
976      $ids = $this->get_budget_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
977      $objects = array();
978      foreach ($ids as $index=>$id)
979      {
980          $objects[$index] = new budget($id);
981      }
982      return $objects;
983  }
publicget_classname ( )[ obj ]
Parameters
No parameters for this method
Code
086  public function get_classname()
087  {
088      return get_class($this);
089  }
public staticget_columns ( columns , order , lookups , where_clause , limit , offset [0] )[ prospect_db ]
Parameters
requiredcolumns
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
190  public static function get_columns($__columns, $__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
191  {
192      $lookups = is_array($__lookups) ? $__lookups : array($__lookups);
193      $colarray = is_array($__columns) ? $__columns : explode(",",$__columns);
194      $colstring = is_array($__columns) ? implode(",",$__columns) : $__columns;
195 
196      $db = prospect::db();
197      $data = array();
198      $q  = " SELECT $colstring ";
199      $q .= " FROM prj_prospect ";
200      $q .= " INNER JOIN prj_projectentity ON prj_prospect.projectentity_id=prj_projectentity.id ";
201      $q .= array_key_exists("projectentitystatus_id",$lookups) ? " AND prj_projectentity.projectentitystatus_id='" . $lookups["projectentitystatus_id"] . "' " : "";
202      $q .= " WHERE prj_prospect.deleted = 0 ";
203      $q .= is_null($__where_clause) ? null : " AND ($__where_clause) ";
204 
205      if (is_string($__order))
206      {
207          $q .= "ORDER BY " . $__order;
208      }
209      else if (is_array($__order) and count($__order)>0)
210      {
211          $orderings = array();
212          foreach ($__order as $col=>$dir)
213          {
214              $orderings[] = " $col $dir ";
215          }
216          $q .= "ORDER BY " . implode(", ", $orderings);
217      }
218      else if (is_object($__order))
219      {
220          $q .= "";
221      }
222      else
223      {
224          // THERE IS NO `order` COLUMN ON THIS OBJECT
225      }
226 
227      if (!is_null($__limit))
228      {
229          $q .= " LIMIT $__offset , $__limit ";
230      }
231 
232      $db->query($q);
233 
234      if (count($colarray)>1 || $colstring=="*")
235      {
236          while ($db->next_record())
237          {
238              $data[] = $db->record;
239          }
240      }
241      else
242      {
243          while ($db->next_record())
244          {
245              $data[] = $db->f(0);
246          }
247      }
248 
249      return $data;
250  }
publicget_comment ( type ["default"] )[ projectentity_db ]
Parameters
optionaltype ["default"]
Code
551  public function get_comment($__type="default")
552  {
553      $object = is_null(keyval($this->property_objects_array,"{$__type}_comment")) ? new comment($this->get_comment_id($__type)) : $this->property_objects_array["{$__type}_comment"];
554      $this->property_objects_array["{$__type}_comment"] = $object;
555      return $object;
556  }
publicget_comment_id ( type ["default"] )[ projectentity_db ]
Parameters
optionaltype ["default"]
Code
557  public function get_comment_id($__type="default")
558  {
559      $ids = $this->get_comment_ids($__type, true);
560      return (count($ids)==1 ? $ids[0] : null);
561  }
publicget_comment_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ projectentity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
562  public function get_comment_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
563  {
564      $comment_ids = array();
565      $db = projectentity::db();
566      $q  = " SELECT cor_comment.id FROM prj_comment_projectentity INNER JOIN cor_comment ON prj_comment_projectentity.comment_id=cor_comment.id AND prj_comment_projectentity.deleted=0 AND cor_comment.deleted=0 AND prj_comment_projectentity.projectentity_id='$this->id' " . (is_null($__type) ? "" : " AND prj_comment_projectentity.comment_projectentity_type_id='" . comment_projectentity::type_id($__type) . "'") . ($__get_primary ? " AND prj_comment_projectentity.primary=1 " : "");
567      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
568      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
569      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
570      $db->query($q);
571      while ($db->next_record())
572      {
573          $comment_ids[] = $db->f("id");
574      }
575      return $comment_ids;
576  }
publicget_comment_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ projectentity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
577  public function get_comment_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
578  {
579      $ids = $this->get_comment_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
580      $objects = array();
581      foreach ($ids as $index=>$id)
582      {
583          $objects[$index] = new comment($id);
584      }
585      return $objects;
586  }
publicget_contract ( type ["default"] )[ projectentity_db ]
Parameters
optionaltype ["default"]
Code
1047  public function get_contract($__type="default")
1048  {
1049      $object = is_null(keyval($this->property_objects_array,"{$__type}_contract")) ? new contract($this->get_contract_id($__type)) : $this->property_objects_array["{$__type}_contract"];
1050      $this->property_objects_array["{$__type}_contract"] = $object;
1051      return $object;
1052  }
publicget_contract_id ( type ["default"] )[ projectentity_db ]
Parameters
optionaltype ["default"]
Code
1053  public function get_contract_id($__type="default")
1054  {
1055      $ids = $this->get_contract_ids($__type, true);
1056      return (count($ids)==1 ? $ids[0] : null);
1057  }
publicget_contract_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ projectentity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
1058  public function get_contract_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
1059  {
1060      $contract_ids = array();
1061      $db = projectentity::db();
1062      $q  = " SELECT cont_contract.id FROM prj_contract_projectentity INNER JOIN cont_contract ON prj_contract_projectentity.contract_id=cont_contract.id AND prj_contract_projectentity.deleted=0 AND cont_contract.deleted=0 AND prj_contract_projectentity.projectentity_id='$this->id' " . (is_null($__type) ? "" : " AND prj_contract_projectentity.contract_projectentity_type_id='" . contract_projectentity::type_id($__type) . "'") . ($__get_primary ? " AND prj_contract_projectentity.primary=1 " : "");
1063      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
1064      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
1065      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
1066      $db->query($q);
1067      while ($db->next_record())
1068      {
1069          $contract_ids[] = $db->f("id");
1070      }
1071      return $contract_ids;
1072  }
publicget_contract_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ projectentity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
1073  public function get_contract_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
1074  {
1075      $ids = $this->get_contract_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
1076      $objects = array();
1077      foreach ($ids as $index=>$id)
1078      {
1079          $objects[$index] = new contract($id);
1080      }
1081      return $objects;
1082  }
publicget_dirty ( )[ obj ]
Parameters
No parameters for this method
Code
063  public function get_dirty()
064  {
065      if ($this->id === 0)
066      {
067          $this->_dirty = true;
068      }
069      else
070      {
071          foreach (get_object_vars($this) as $k=>$v)
072          {
073              if ($this->_dirty)
074              {
075                  break;
076              }
077              if (preg_match('/_dirty$/',$k))
078              {
079                  $this->_dirty = $this->_dirty || $v;
080              }
081          }
082      }
083      return $this->_dirty;
084  }
publicget_employee ( type ["default"] )[ projectentity_db ]
Parameters
optionaltype ["default"]
Code
452  public function get_employee($__type="default")
453  {
454      $object = is_null(keyval($this->property_objects_array,"{$__type}_employee")) ? new employee($this->get_employee_id($__type)) : $this->property_objects_array["{$__type}_employee"];
455      $this->property_objects_array["{$__type}_employee"] = $object;
456      return $object;
457  }
publicget_employee_id ( type ["default"] )[ projectentity_db ]
Parameters
optionaltype ["default"]
Code
458  public function get_employee_id($__type="default")
459  {
460      $ids = $this->get_employee_ids($__type, true);
461      return (count($ids)==1 ? $ids[0] : null);
462  }
publicget_employee_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ projectentity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
463  public function get_employee_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
464  {
465      $employee_ids = array();
466      $db = projectentity::db();
467      $q  = " SELECT hr_employee.person_entity_id FROM prj_employee_projectentity INNER JOIN hr_employee ON prj_employee_projectentity.employee_person_entity_id=hr_employee.person_entity_id AND prj_employee_projectentity.deleted=0 AND hr_employee.deleted=0 AND prj_employee_projectentity.projectentity_id='$this->id' " . (is_null($__type) ? "" : " AND prj_employee_projectentity.employee_projectentity_type_id='" . employee_projectentity::type_id($__type) . "'") . ($__get_primary ? " AND prj_employee_projectentity.primary=1 " : "");
468      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
469      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
470      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
471      $db->query($q);
472      while ($db->next_record())
473      {
474          $employee_ids[] = $db->f("person_entity_id");
475      }
476      return $employee_ids;
477  }
publicget_employee_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ projectentity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
478  public function get_employee_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
479  {
480      $ids = $this->get_employee_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
481      $objects = array();
482      foreach ($ids as $index=>$id)
483      {
484          $objects[$index] = new employee($id);
485      }
486      return $objects;
487  }
publicget_entity ( type ["default"] )[ projectentity_db ]
Parameters
optionaltype ["default"]
Code
353  public function get_entity($__type="default")
354  {
355      $object = is_null(keyval($this->property_objects_array,"{$__type}_entity")) ? new entity($this->get_entity_id($__type)) : $this->property_objects_array["{$__type}_entity"];
356      $this->property_objects_array["{$__type}_entity"] = $object;
357      return $object;
358  }
publicget_entity_id ( type ["default"] )[ projectentity_db ]
Parameters
optionaltype ["default"]
Code
359  public function get_entity_id($__type="default")
360  {
361      $ids = $this->get_entity_ids($__type, true);
362      return (count($ids)==1 ? $ids[0] : null);
363  }
publicget_entity_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ projectentity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
364  public function get_entity_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
365  {
366      $entity_ids = array();
367      $db = projectentity::db();
368      $q  = " SELECT cor_entity.id FROM prj_entity_projectentity INNER JOIN cor_entity ON prj_entity_projectentity.entity_id=cor_entity.id AND prj_entity_projectentity.deleted=0 AND cor_entity.deleted=0 AND prj_entity_projectentity.projectentity_id='$this->id' " . (is_null($__type) ? "" : " AND prj_entity_projectentity.entity_projectentity_type_id='" . entity_projectentity::type_id($__type) . "'") . ($__get_primary ? " AND prj_entity_projectentity.primary=1 " : "");
369      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
370      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
371      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
372      $db->query($q);
373      while ($db->next_record())
374      {
375          $entity_ids[] = $db->f("id");
376      }
377      return $entity_ids;
378  }
publicget_entity_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ projectentity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
379  public function get_entity_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
380  {
381      $ids = $this->get_entity_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
382      $objects = array();
383      foreach ($ids as $index=>$id)
384      {
385          $objects[$index] = new entity($id);
386      }
387      return $objects;
388  }
public staticget_ids ( order , lookups , where_clause , limit , offset [0] )[ prospect_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
252  public static function get_ids($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
253  {
254      return prospect::get_columns("projectentity_id", $__order, $__lookups, $__where_clause, $__limit, $__offset);
255  }
publicget_json ( )[ obj ]
Parameters
No parameters for this method
Code
101  public function get_json()
102  {
103      $class = new ReflectionClass($this->classname);
104      $methods = $class->getMethods();
105      usort($methods,"sort_reflection_objects");
106      $accessors = array();
107      foreach ($methods as $index=>$method)
108      {
109          $declarer = $method->getDeclaringClass()->name;
110          if (preg_match('/^(get|set|)_(.+)$/',$method->name,$matches))
111          {
112              $accessor = $matches[2];
113              $getset = $matches[1];
114              eval("\$accessors[\$accessor] = \$this->".$accessor.";");
115          }
116      }
117      //return json_encode($this->get_array());
118      return json_encode($accessors);
119  }
public staticget_objects ( order , lookups , where_clause , limit , offset [0] )[ prospect_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
257  public static function get_objects($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
258  {
259      $objects = array();
260      foreach (prospect::get_columns("projectentity_id", $__order, $__lookups, $__where_clause, $__limit, $__offset) as $id)
261      {
262          $objects[] = new prospect($id);
263      }
264      return $objects;
265  }
publicget_projectentity ( )[ prospect_db ]
Parameters
No parameters for this method
Code
331  public function get_projectentity()
332  {
333      return new projectentity($this->projectentity_id);
334  }
publicget_projectentitydate ( type ["default"] )[ projectentity_db ]
Parameters
optionaltype ["default"]
Code
850  public function get_projectentitydate($__type="default")
851  {
852      $object = is_null(keyval($this->property_objects_array,"{$__type}_projectentitydate")) ? new projectentitydate($this->get_projectentitydate_id($__type)) : $this->property_objects_array["{$__type}_projectentitydate"];
853      $this->property_objects_array["{$__type}_projectentitydate"] = $object;
854      return $object;
855  }
publicget_projectentitydate_id ( type ["default"] )[ projectentity_db ]
Parameters
optionaltype ["default"]
Code
856  public function get_projectentitydate_id($__type="default")
857  {
858      $ids = $this->get_projectentitydate_ids($__type, true);
859      return (count($ids)==1 ? $ids[0] : null);
860  }
publicget_projectentitydate_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ projectentity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
861  public function get_projectentitydate_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
862  {
863      $projectentitydate_ids = array();
864      $db = projectentity::db();
865      $q  = " SELECT prj_projectentitydate.id FROM prj_projectentity_projectentitydate INNER JOIN prj_projectentitydate ON prj_projectentity_projectentitydate.projectentitydate_id=prj_projectentitydate.id AND prj_projectentity_projectentitydate.deleted=0 AND prj_projectentitydate.deleted=0 AND prj_projectentity_projectentitydate.projectentity_id='$this->id' " . (is_null($__type) ? "" : " AND prj_projectentity_projectentitydate.projectentity_projectentitydate_type_id='" . projectentity_projectentitydate::type_id($__type) . "'") . ($__get_primary ? " AND prj_projectentity_projectentitydate.primary=1 " : "");
866      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
867      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
868      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
869      $db->query($q);
870      while ($db->next_record())
871      {
872          $projectentitydate_ids[] = $db->f("id");
873      }
874      return $projectentitydate_ids;
875  }
publicget_projectentitydate_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ projectentity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
876  public function get_projectentitydate_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
877  {
878      $ids = $this->get_projectentitydate_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
879      $objects = array();
880      foreach ($ids as $index=>$id)
881      {
882          $objects[$index] = new projectentitydate($id);
883      }
884      return $objects;
885  }
publicget_projectentitystatus ( )[ projectentity_db ]
Parameters
No parameters for this method
Code
341  public function get_projectentitystatus()
342  {
343      return new projectentitystatus($this->projectentitystatus_id);
344  }
publicget_properties ( )[ obj ]
Parameters
No parameters for this method
Code
121  public function get_properties()
122  {
123      return array_keys($this->array);
124  }
publicget_resource ( type ["default"] )[ projectentity_db ]
Parameters
optionaltype ["default"]
Code
650  public function get_resource($__type="default")
651  {
652      $object = is_null(keyval($this->property_objects_array,"{$__type}_resource")) ? new resource($this->get_resource_id($__type)) : $this->property_objects_array["{$__type}_resource"];
653      $this->property_objects_array["{$__type}_resource"] = $object;
654      return $object;
655  }
publicget_resource_id ( type ["default"] )[ projectentity_db ]
Parameters
optionaltype ["default"]
Code
656  public function get_resource_id($__type="default")
657  {
658      $ids = $this->get_resource_ids($__type, true);
659      return (count($ids)==1 ? $ids[0] : null);
660  }
publicget_resource_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ projectentity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
661  public function get_resource_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
662  {
663      $resource_ids = array();
664      $db = projectentity::db();
665      $q  = " SELECT cor_resource.id FROM prj_projectentity_resource INNER JOIN cor_resource ON prj_projectentity_resource.resource_id=cor_resource.id AND prj_projectentity_resource.deleted=0 AND cor_resource.deleted=0 AND prj_projectentity_resource.projectentity_id='$this->id' " . (is_null($__type) ? "" : " AND prj_projectentity_resource.projectentity_resource_type_id='" . projectentity_resource::type_id($__type) . "'") . ($__get_primary ? " AND prj_projectentity_resource.primary=1 " : "");
666      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
667      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
668      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
669      $db->query($q);
670      while ($db->next_record())
671      {
672          $resource_ids[] = $db->f("id");
673      }
674      return $resource_ids;
675  }
publicget_resource_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ projectentity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
676  public function get_resource_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
677  {
678      $ids = $this->get_resource_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
679      $objects = array();
680      foreach ($ids as $index=>$id)
681      {
682          $objects[$index] = new resource($id);
683      }
684      return $objects;
685  }
protectedget_string ( )[ obj ]
Parameters
No parameters for this method
Code
091  protected function get_string()
092  {
093      return method_exists($this,"__toString") ? $this->__toString() : null;
094  }
publicget_task ( type ["default"] )[ projectentity_db ]
Parameters
optionaltype ["default"]
Code
751  public function get_task($__type="default")
752  {
753      $object = is_null(keyval($this->property_objects_array,"{$__type}_task")) ? new task($this->get_task_id($__type)) : $this->property_objects_array["{$__type}_task"];
754      $this->property_objects_array["{$__type}_task"] = $object;
755      return $object;
756  }
publicget_task_id ( type ["default"] )[ projectentity_db ]
Parameters
optionaltype ["default"]
Code
757  public function get_task_id($__type="default")
758  {
759      $ids = $this->get_task_ids($__type, true);
760      return (count($ids)==1 ? $ids[0] : null);
761  }
publicget_task_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ projectentity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
762  public function get_task_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
763  {
764      $task_ids = array();
765      $db = projectentity::db();
766      $q  = " SELECT prj_task.id FROM prj_projectentity_task INNER JOIN prj_task ON prj_projectentity_task.task_id=prj_task.id AND prj_projectentity_task.deleted=0 AND prj_task.deleted=0 AND prj_projectentity_task.projectentity_id='$this->id' " . (is_null($__type) ? "" : " AND prj_projectentity_task.projectentity_task_type_id='" . projectentity_task::type_id($__type) . "'") . ($__get_primary ? " AND prj_projectentity_task.primary=1 " : "");
767      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
768      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
769      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
770      $db->query($q);
771      while ($db->next_record())
772      {
773          $task_ids[] = $db->f("id");
774      }
775      return $task_ids;
776  }
publicget_task_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ projectentity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
777  public function get_task_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
778  {
779      $ids = $this->get_task_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
780      $objects = array();
781      foreach ($ids as $index=>$id)
782      {
783          $objects[$index] = new task($id);
784      }
785      return $objects;
786  }
protectedinsert ( )[ prospect_db ]
Parameters
No parameters for this method
Code
123  protected function insert()
124  {
125      parent::insert();
126      $this->_projectentity_id = $this->id;
127      $db = prospect::db();
128      $q  = " INSERT INTO prj_prospect ( ";
129      $q .= $db->param_string("projectentity_id") . ", ";
130      $q .= $db->param_string("mdate") . ", ";
131      $q .= $db->param_string("cdate") . ", ";
132      $q .= $db->param_string("deleted");
133      $q .= " ) VALUES ( ";
134      $q .= $db->value_string($this->_projectentity_id) . ", ";
135      $q .= $db->value_string(timestamp()) . ", ";
136      $q .= $db->value_string(timestamp()) . ", ";
137      $q .= $this->deleted ? "'1'" : "'0'";
138      $q .= " ) ";
139      $db->query($q);
140      return true;
141  }
publicmap ( )[ prospect_db ]
Parameters
No parameters for this method
Code
093  public function map()
094  {
095      $this->_name = array_key_exists("prospect:name",$_REQUEST) ? reqval("prospect:name") : $this->_name;
096      $this->_code = array_key_exists("prospect:code",$_REQUEST) ? reqval("prospect:code") : $this->_code;
097      $this->_description = array_key_exists("prospect:description",$_REQUEST) ? reqval("prospect:description") : $this->_description;
098      $this->_projectentitystatus_id = array_key_exists("prospect:projectentitystatus_id",$_REQUEST) ? reqval("prospect:projectentitystatus_id") : $this->_projectentitystatus_id;
099      $this->_mdate = array_key_exists("prospect:mdate",$_REQUEST) ? reqval("prospect:mdate") : $this->_mdate;
100      $this->_cdate = array_key_exists("prospect:cdate",$_REQUEST) ? reqval("prospect:cdate") : $this->_cdate;
101      $this->_deleted = array_key_exists("prospect:deleted",$_REQUEST) ? reqval("prospect:deleted") : $this->_deleted;
102  }
publicpurge ( )[ prospect_db ]
Parameters
No parameters for this method
Code
180  public function purge()
181  {
182      parent::purge();
183      $db = prospect::db();
184      $q  = " DELETE FROM prj_prospect ";
185      $q .= " WHERE projectentity_id = " . $this->_projectentity_id;
186      $db->query($q);
187      return true;
188  }
public staticsearch ( keyword )[ prospect_db ]
public__set ( p , v )[ obj ]
Parameters
requiredp
requiredv
Code
030  public function __set($p,$v)
031  {
032      $methods = get_class_methods($this);
033      $properties = get_object_vars($this);
034      if (in_array("set_$p",$methods))
035      {
036          $this->{"set_$p"}($v);
037      }
038      else if (array_key_exists("_$p",$properties))
039      {
040          if (!preg_match('/_dirty$/',$p) && property_exists($this,"_{$p}_dirty"))
041          {
042              if (is_object($this->{"_$p"}))
043              {
044                  $this->{"_$p"}->dirty = true;
045              }
046              else
047              {
048                  $this->{"_{$p}_dirty"} = $this->{$p}==$v ? false : true;
049              }
050          }
051          $this->{"_$p"} = $v;
052      }
053      else if (in_array("set_" . substr($p,strpos($p,"_")+1), $methods))
054      {
055          $this->{"set_" . substr($p,strpos($p,"_")+1)}($v,substr($p,0,strpos($p,"_")));
056      }
057      else
058      {
059          trigger_error("This object [" . get_class($this) . ":$this->id] has no private property '_$p' for the requested public property '$p'",E_USER_WARNING);
060      }
061  }
publicset_budget ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
985  public function set_budget($__v, $__type="default")
986  {
987      $object = is_null(keyval($this->property_objects_array,"{$__type}_budget")) ? new budget($this->get_budget_id($__type)) : $this->property_objects_array["{$__type}_budget"];
988      if (is_null($__v))
989      {
990          $rel = new budget_projectentity(null,$object->id,$this->id,budget_projectentity::type_id($__type));
991          $rel->delete();
992          if (!is_null(keyval($this->property_objects_array,"{$__type}_budget")))
993          {
994              $this->property_objects_array["{$__type}_budget"] = null;
995          }
996      }
997      else
998      {
999          $id = $object->id;
1000          $object = $__v;
1001          $object->id = $__v->id>0 ? $__v->id : $id;
1002          $object->commit();
1003          $this->set_budget_ids(array($object->id),$__type);
1004      }
1005  }
publicset_budget_id ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1006  public function set_budget_id($__v, $__type="default")
1007  {
1008      $this->set_budget_ids(array($__v),$__type);
1009  }
publicset_budget_ids ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1010  public function set_budget_ids($__v, $__type="default")
1011  {
1012      if ($this->id == 0)
1013      {
1014          $this->commit();
1015      }
1016      $type_id = budget_projectentity::type_id($__type);
1017      budget_projectentity::delete_all(null,$this->id,$type_id);
1018      if (is_array($__v))
1019      {
1020          foreach ($__v as $index=>$id)
1021          {
1022              $object = new budget_projectentity(null,$id,$this->id,$type_id);
1023              $object->deleted = false;
1024              $object->budget_projectentity_type_id = $type_id;
1025              $object->commit();
1026              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_budget")))
1027              {
1028                  $this->property_objects_array["{$__type}_budget"] = new budget($object->budget_id);
1029              }
1030          }
1031          $this->_dirty = true;
1032      }
1033  }
publicset_budget_list ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1034  public function set_budget_list($__v, $__type="default")
1035  {
1036      if (is_array($__v))
1037      {
1038          $ids = array();
1039          foreach ($__v as $index=>$object)
1040          {
1041              $ids[] = $object->id;
1042          }
1043          $this->set_budget_ids($ids,$__type);
1044      }
1045  }
publicset_comment ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
588  public function set_comment($__v, $__type="default")
589  {
590      $object = is_null(keyval($this->property_objects_array,"{$__type}_comment")) ? new comment($this->get_comment_id($__type)) : $this->property_objects_array["{$__type}_comment"];
591      if (is_null($__v))
592      {
593          $rel = new comment_projectentity(null,$object->id,$this->id,comment_projectentity::type_id($__type));
594          $rel->delete();
595          if (!is_null(keyval($this->property_objects_array,"{$__type}_comment")))
596          {
597              $this->property_objects_array["{$__type}_comment"] = null;
598          }
599      }
600      else
601      {
602          $id = $object->id;
603          $object = $__v;
604          $object->id = $__v->id>0 ? $__v->id : $id;
605          $object->commit();
606          $this->set_comment_ids(array($object->id),$__type);
607      }
608  }
publicset_comment_id ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
609  public function set_comment_id($__v, $__type="default")
610  {
611      $this->set_comment_ids(array($__v),$__type);
612  }
publicset_comment_ids ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
613  public function set_comment_ids($__v, $__type="default")
614  {
615      if ($this->id == 0)
616      {
617          $this->commit();
618      }
619      $type_id = comment_projectentity::type_id($__type);
620      comment_projectentity::delete_all(null,$this->id,$type_id);
621      if (is_array($__v))
622      {
623          foreach ($__v as $index=>$id)
624          {
625              $object = new comment_projectentity(null,$id,$this->id,$type_id);
626              $object->deleted = false;
627              $object->comment_projectentity_type_id = $type_id;
628              $object->commit();
629              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_comment")))
630              {
631                  $this->property_objects_array["{$__type}_comment"] = new comment($object->comment_id);
632              }
633          }
634          $this->_dirty = true;
635      }
636  }
publicset_comment_list ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
637  public function set_comment_list($__v, $__type="default")
638  {
639      if (is_array($__v))
640      {
641          $ids = array();
642          foreach ($__v as $index=>$object)
643          {
644              $ids[] = $object->id;
645          }
646          $this->set_comment_ids($ids,$__type);
647      }
648  }
publicset_contract ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1084  public function set_contract($__v, $__type="default")
1085  {
1086      $object = is_null(keyval($this->property_objects_array,"{$__type}_contract")) ? new contract($this->get_contract_id($__type)) : $this->property_objects_array["{$__type}_contract"];
1087      if (is_null($__v))
1088      {
1089          $rel = new contract_projectentity(null,$object->id,$this->id,contract_projectentity::type_id($__type));
1090          $rel->delete();
1091          if (!is_null(keyval($this->property_objects_array,"{$__type}_contract")))
1092          {
1093              $this->property_objects_array["{$__type}_contract"] = null;
1094          }
1095      }
1096      else
1097      {
1098          $id = $object->id;
1099          $object = $__v;
1100          $object->id = $__v->id>0 ? $__v->id : $id;
1101          $object->commit();
1102          $this->set_contract_ids(array($object->id),$__type);
1103      }
1104  }
publicset_contract_id ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1105  public function set_contract_id($__v, $__type="default")
1106  {
1107      $this->set_contract_ids(array($__v),$__type);
1108  }
publicset_contract_ids ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1109  public function set_contract_ids($__v, $__type="default")
1110  {
1111      if ($this->id == 0)
1112      {
1113          $this->commit();
1114      }
1115      $type_id = contract_projectentity::type_id($__type);
1116      contract_projectentity::delete_all(null,$this->id,$type_id);
1117      if (is_array($__v))
1118      {
1119          foreach ($__v as $index=>$id)
1120          {
1121              $object = new contract_projectentity(null,$id,$this->id,$type_id);
1122              $object->deleted = false;
1123              $object->contract_projectentity_type_id = $type_id;
1124              $object->commit();
1125              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_contract")))
1126              {
1127                  $this->property_objects_array["{$__type}_contract"] = new contract($object->contract_id);
1128              }
1129          }
1130          $this->_dirty = true;
1131      }
1132  }
publicset_contract_list ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1133  public function set_contract_list($__v, $__type="default")
1134  {
1135      if (is_array($__v))
1136      {
1137          $ids = array();
1138          foreach ($__v as $index=>$object)
1139          {
1140              $ids[] = $object->id;
1141          }
1142          $this->set_contract_ids($ids,$__type);
1143      }
1144  }
publicset_employee ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
489  public function set_employee($__v, $__type="default")
490  {
491      $object = is_null(keyval($this->property_objects_array,"{$__type}_employee")) ? new employee($this->get_employee_id($__type)) : $this->property_objects_array["{$__type}_employee"];
492      if (is_null($__v))
493      {
494          $rel = new employee_projectentity(null,$object->id,$this->id,employee_projectentity::type_id($__type));
495          $rel->delete();
496          if (!is_null(keyval($this->property_objects_array,"{$__type}_employee")))
497          {
498              $this->property_objects_array["{$__type}_employee"] = null;
499          }
500      }
501      else
502      {
503          $id = $object->id;
504          $object = $__v;
505          $object->id = $__v->id>0 ? $__v->id : $id;
506          $object->commit();
507          $this->set_employee_ids(array($object->id),$__type);
508      }
509  }
publicset_employee_id ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
510  public function set_employee_id($__v, $__type="default")
511  {
512      $this->set_employee_ids(array($__v),$__type);
513  }
publicset_employee_ids ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
514  public function set_employee_ids($__v, $__type="default")
515  {
516      if ($this->id == 0)
517      {
518          $this->commit();
519      }
520      $type_id = employee_projectentity::type_id($__type);
521      employee_projectentity::delete_all(null,$this->id,$type_id);
522      if (is_array($__v))
523      {
524          foreach ($__v as $index=>$id)
525          {
526              $object = new employee_projectentity(null,$id,$this->id,$type_id);
527              $object->deleted = false;
528              $object->employee_projectentity_type_id = $type_id;
529              $object->commit();
530              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_employee")))
531              {
532                  $this->property_objects_array["{$__type}_employee"] = new employee($object->employee_id);
533              }
534          }
535          $this->_dirty = true;
536      }
537  }
publicset_employee_list ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
538  public function set_employee_list($__v, $__type="default")
539  {
540      if (is_array($__v))
541      {
542          $ids = array();
543          foreach ($__v as $index=>$object)
544          {
545              $ids[] = $object->id;
546          }
547          $this->set_employee_ids($ids,$__type);
548      }
549  }
publicset_entity ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
390  public function set_entity($__v, $__type="default")
391  {
392      $object = is_null(keyval($this->property_objects_array,"{$__type}_entity")) ? new entity($this->get_entity_id($__type)) : $this->property_objects_array["{$__type}_entity"];
393      if (is_null($__v))
394      {
395          $rel = new entity_projectentity(null,$object->id,$this->id,entity_projectentity::type_id($__type));
396          $rel->delete();
397          if (!is_null(keyval($this->property_objects_array,"{$__type}_entity")))
398          {
399              $this->property_objects_array["{$__type}_entity"] = null;
400          }
401      }
402      else
403      {
404          $id = $object->id;
405          $object = $__v;
406          $object->id = $__v->id>0 ? $__v->id : $id;
407          $object->commit();
408          $this->set_entity_ids(array($object->id),$__type);
409      }
410  }
publicset_entity_id ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
411  public function set_entity_id($__v, $__type="default")
412  {
413      $this->set_entity_ids(array($__v),$__type);
414  }
publicset_entity_ids ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
415  public function set_entity_ids($__v, $__type="default")
416  {
417      if ($this->id == 0)
418      {
419          $this->commit();
420      }
421      $type_id = entity_projectentity::type_id($__type);
422      entity_projectentity::delete_all(null,$this->id,$type_id);
423      if (is_array($__v))
424      {
425          foreach ($__v as $index=>$id)
426          {
427              $object = new entity_projectentity(null,$id,$this->id,$type_id);
428              $object->deleted = false;
429              $object->entity_projectentity_type_id = $type_id;
430              $object->commit();
431              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_entity")))
432              {
433                  $this->property_objects_array["{$__type}_entity"] = new entity($object->entity_id);
434              }
435          }
436          $this->_dirty = true;
437      }
438  }
publicset_entity_list ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
439  public function set_entity_list($__v, $__type="default")
440  {
441      if (is_array($__v))
442      {
443          $ids = array();
444          foreach ($__v as $index=>$object)
445          {
446              $ids[] = $object->id;
447          }
448          $this->set_entity_ids($ids,$__type);
449      }
450  }
publicset_projectentity ( v )[ prospect_db ]
Parameters
requiredv
Code
335  public function set_projectentity($v)
336  {
337      if ($v->id > 0)
338      {
339          $this->projectentity_id = $v->id;
340      }
341  }
publicset_projectentitydate ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
887  public function set_projectentitydate($__v, $__type="default")
888  {
889      $object = is_null(keyval($this->property_objects_array,"{$__type}_projectentitydate")) ? new projectentitydate($this->get_projectentitydate_id($__type)) : $this->property_objects_array["{$__type}_projectentitydate"];
890      if (is_null($__v))
891      {
892          $rel = new projectentity_projectentitydate(null,$this->id,$object->id,projectentity_projectentitydate::type_id($__type));
893          $rel->delete();
894          $object->delete();
895          if (!is_null(keyval($this->property_objects_array,"{$__type}_projectentitydate")))
896          {
897              $this->property_objects_array["{$__type}_projectentitydate"] = null;
898          }
899      }
900      else
901      {
902          $object->value = is_object($__v) ? $__v->value : $__v;
903          $object->commit();
904          $this->set_projectentitydate_ids(array($object->id),$__type);
905      }
906  }
publicset_projectentitydate_id ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
907  public function set_projectentitydate_id($__v, $__type="default")
908  {
909      $this->set_projectentitydate_ids(array($__v),$__type);
910  }
publicset_projectentitydate_ids ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
911  public function set_projectentitydate_ids($__v, $__type="default")
912  {
913      if ($this->id == 0)
914      {
915          $this->commit();
916      }
917      $type_id = projectentity_projectentitydate::type_id($__type);
918      projectentity_projectentitydate::delete_all($this->id,null,$type_id);
919      if (is_array($__v))
920      {
921          foreach ($__v as $index=>$id)
922          {
923              $object = new projectentity_projectentitydate(null,$this->id,$id,$type_id);
924              $object->deleted = false;
925              $object->projectentity_projectentitydate_type_id = $type_id;
926              $object->commit();
927              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_projectentitydate")))
928              {
929                  $this->property_objects_array["{$__type}_projectentitydate"] = new projectentitydate($object->projectentitydate_id);
930              }
931          }
932          $this->_dirty = true;
933      }
934  }
publicset_projectentitydate_list ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
935  public function set_projectentitydate_list($__v, $__type="default")
936  {
937      if (is_array($__v))
938      {
939          $ids = array();
940          foreach ($__v as $index=>$object)
941          {
942              $ids[] = $object->id;
943          }
944          $this->set_projectentitydate_ids($ids,$__type);
945      }
946  }
publicset_projectentitystatus ( v )[ projectentity_db ]
Parameters
requiredv
Code
345  public function set_projectentitystatus($v)
346  {
347      if ($v->id > 0)
348      {
349          $this->projectentitystatus_id = $v->id;
350      }
351  }
publicset_resource ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
687  public function set_resource($__v, $__type="default")
688  {
689      $object = is_null(keyval($this->property_objects_array,"{$__type}_resource")) ? new resource($this->get_resource_id($__type)) : $this->property_objects_array["{$__type}_resource"];
690      if (is_null($__v))
691      {
692          $rel = new projectentity_resource(null,$this->id,$object->id,projectentity_resource::type_id($__type));
693          $rel->delete();
694          if (!is_null(keyval($this->property_objects_array,"{$__type}_resource")))
695          {
696              $this->property_objects_array["{$__type}_resource"] = null;
697          }
698      }
699      else
700      {
701          $hash = $object->hash;
702          $id = $object->id;
703          $object = $__v;
704          $object->hash = $__v->id>0 ? $__v->hash : $hash;
705          $object->id = $__v->id>0 ? $__v->id : $id;
706          $object->commit();
707          $this->set_resource_ids(array($object->id),$__type);
708      }
709  }
publicset_resource_id ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
710  public function set_resource_id($__v, $__type="default")
711  {
712      $this->set_resource_ids(array($__v),$__type);
713  }
publicset_resource_ids ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
714  public function set_resource_ids($__v, $__type="default")
715  {
716      if ($this->id == 0)
717      {
718          $this->commit();
719      }
720      $type_id = projectentity_resource::type_id($__type);
721      projectentity_resource::delete_all($this->id,null,$type_id);
722      if (is_array($__v))
723      {
724          foreach ($__v as $index=>$id)
725          {
726              $object = new projectentity_resource(null,$this->id,$id,$type_id);
727              $object->deleted = false;
728              $object->projectentity_resource_type_id = $type_id;
729              $object->commit();
730              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_resource")))
731              {
732                  $this->property_objects_array["{$__type}_resource"] = new resource($object->resource_id);
733              }
734          }
735          $this->_dirty = true;
736      }
737  }
publicset_resource_list ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
738  public function set_resource_list($__v, $__type="default")
739  {
740      if (is_array($__v))
741      {
742          $ids = array();
743          foreach ($__v as $index=>$object)
744          {
745              $ids[] = $object->id;
746          }
747          $this->set_resource_ids($ids,$__type);
748      }
749  }
publicset_task ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
788  public function set_task($__v, $__type="default")
789  {
790      $object = is_null(keyval($this->property_objects_array,"{$__type}_task")) ? new task($this->get_task_id($__type)) : $this->property_objects_array["{$__type}_task"];
791      if (is_null($__v))
792      {
793          $rel = new projectentity_task(null,$this->id,$object->id,projectentity_task::type_id($__type));
794          $rel->delete();
795          if (!is_null(keyval($this->property_objects_array,"{$__type}_task")))
796          {
797              $this->property_objects_array["{$__type}_task"] = null;
798          }
799      }
800      else
801      {
802          $id = $object->id;
803          $object = $__v;
804          $object->id = $__v->id>0 ? $__v->id : $id;
805          $object->commit();
806          $this->set_task_ids(array($object->id),$__type);
807      }
808  }
publicset_task_id ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
809  public function set_task_id($__v, $__type="default")
810  {
811      $this->set_task_ids(array($__v),$__type);
812  }
publicset_task_ids ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
813  public function set_task_ids($__v, $__type="default")
814  {
815      if ($this->id == 0)
816      {
817          $this->commit();
818      }
819      $type_id = projectentity_task::type_id($__type);
820      projectentity_task::delete_all($this->id,null,$type_id);
821      if (is_array($__v))
822      {
823          foreach ($__v as $index=>$id)
824          {
825              $object = new projectentity_task(null,$this->id,$id,$type_id);
826              $object->deleted = false;
827              $object->projectentity_task_type_id = $type_id;
828              $object->commit();
829              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_task")))
830              {
831                  $this->property_objects_array["{$__type}_task"] = new task($object->task_id);
832              }
833          }
834          $this->_dirty = true;
835      }
836  }
publicset_task_list ( v , type ["default"] )[ projectentity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
837  public function set_task_list($__v, $__type="default")
838  {
839      if (is_array($__v))
840      {
841          $ids = array();
842          foreach ($__v as $index=>$object)
843          {
844              $ids[] = $object->id;
845          }
846          $this->set_task_ids($ids,$__type);
847      }
848  }
public__toString ( )[ prospect_db ]
Parameters
No parameters for this method
Code
326  public function __toString()
327  {
328      return (is_null($this->id) ? "" : $this->id);
329  }
publicundelete ( )[ prospect_db ]
Parameters
No parameters for this method
Code
168  public function undelete()
169  {
170      parent::undelete();
171      $db = prospect::db();
172      $q  = " UPDATE prj_prospect SET ";
173      $q .= " deleted = 0 ";
174      $q .= " WHERE projectentity_id = " . $this->_projectentity_id;
175      $db->query($q);
176      $this->deleted = false;
177      return true;
178  }
protectedupdate ( )[ prospect_db ]
Parameters
No parameters for this method
Code
143  protected function update()
144  {
145      parent::update();
146      $db = prospect::db();
147      $q  = " UPDATE prj_prospect SET ";
148      $q .= $db->param_string("projectentity_id") . " = " . $db->value_string($this->_projectentity_id) . ", ";
149      $q .= $db->param_string("mdate") . " = " . $db->value_string(timestamp()) . ", ";
150      $q .= $db->param_string("deleted") . " = " . ($this->deleted ? "'1'" : "'0'");
151      $q .= " WHERE projectentity_id = " . $this->_projectentity_id;
152      $db->query($q);
153      return true;
154  }
 
Accessors
publicarray[ obj ]
Code
096  public function get_array()
097  {
098      return get_object_vars($this);
099  }
publicbudget[ projectentity_db ]
Code
948  public function get_budget($__type="default")
949  {
950      $object = is_null(keyval($this->property_objects_array,"{$__type}_budget")) ? new budget($this->get_budget_id($__type)) : $this->property_objects_array["{$__type}_budget"];
951      $this->property_objects_array["{$__type}_budget"] = $object;
952      return $object;
953  }
Code
985  public function set_budget($__v, $__type="default")
986  {
987      $object = is_null(keyval($this->property_objects_array,"{$__type}_budget")) ? new budget($this->get_budget_id($__type)) : $this->property_objects_array["{$__type}_budget"];
988      if (is_null($__v))
989      {
990          $rel = new budget_projectentity(null,$object->id,$this->id,budget_projectentity::type_id($__type));
991          $rel->delete();
992          if (!is_null(keyval($this->property_objects_array,"{$__type}_budget")))
993          {
994              $this->property_objects_array["{$__type}_budget"] = null;
995          }
996      }
997      else
998      {
999          $id = $object->id;
1000          $object = $__v;
1001          $object->id = $__v->id>0 ? $__v->id : $id;
1002          $object->commit();
1003          $this->set_budget_ids(array($object->id),$__type);
1004      }
1005  }
publicbudget_id[ projectentity_db ]
Code
954  public function get_budget_id($__type="default")
955  {
956      $ids = $this->get_budget_ids($__type, true);
957      return (count($ids)==1 ? $ids[0] : null);
958  }
Code
1006  public function set_budget_id($__v, $__type="default")
1007  {
1008      $this->set_budget_ids(array($__v),$__type);
1009  }
publicbudget_ids[ projectentity_db ]
Code
959  public function get_budget_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
960  {
961      $budget_ids </