Helix Installation   Getting Started   Reference Documentation   Global Functions   Quick Start
ModulesClassesFunctions
 

Class Reference

class organization extends organization_ext

Hide Inherited MembersBusiness Management
Description
No description.
 
Constants
constantTABLENAME ["bus_organization"][ organization ]
 
Properties
protected_cdate[ organization_db ]
protected_cdate_dirty[ organization_db ]
protected_deleted[ organization_db ]
protected_deleted_dirty[ organization_db ]
protected_description[ entity_db ]
protected_description_dirty[ entity_db ]
protected_dirty[ obj ]
protected_entity_id[ organization_db ]
protected_entity_id_dirty[ organization_db ]
protected_entity_type_id[ entity_db ]
protected_entity_type_id_dirty[ entity_db ]
protected__id[ organization_db ]
protected_id[ entity_db ]
protected__id_dirty[ organization_db ]
protected_id_dirty[ entity_db ]
protected_mdate[ organization_db ]
protected_mdate_dirty[ organization_db ]
protected_name[ organization_db ]
protected_name_dirty[ organization_db ]
protected_organization_type_id[ organization_db ]
protected_organization_type_id_dirty[ organization_db ]
publicproperty_objects_array[ obj ]
 
Methods
publiccommit ( )[ organization_db ]
Parameters
No parameters for this method
Code
107  public function commit()
108  {
109      if ($this->_entity_id > 0)
110      {
111          $this->update();
112      }
113      else
114      {
115          $this->insert();
116      }
117 
118      foreach ($this->property_objects_array as $property=>$object)
119      {
120          $this->{$property} = $object;
121      }
122 
123      return true;
124  }
public__construct ( entity_id , name )[ organization_db ]
Parameters
optionalentity_id
optionalname
Code
044  public function __construct($__entity_id=null, $__name=null)
045  {
046      $this->__id = 0;
047      $this->_entity_id = 0;
048      $this->_name = $__name;
049      $this->_organization_type_id = 0;
050      $this->_mdate = null;
051      $this->_cdate = null;
052      $this->_deleted = false;
053      $this->_id = 0;
054      $this->_description = "";
055      $this->_entity_type_id = 0;
056 
057      $this->__id_dirty = false;
058      $this->_entity_id_dirty = false;
059      $this->_name_dirty = false;
060      $this->_organization_type_id_dirty = false;
061      $this->_mdate_dirty = false;
062      $this->_cdate_dirty = false;
063      $this->_deleted_dirty = false;
064      $this->_id_dirty = false;
065      $this->_description_dirty = false;
066      $this->_entity_type_id_dirty = false;
067 
068      if (is_null($__entity_id) && is_null($__name))
069      {
070          return;
071      }
072 
073      $db = organization::db();
074      $q  = " SELECT cor_entity.id,cor_entity.description,cor_entity.entity_type_id,bus_organization._id,bus_organization.entity_id,bus_organization.name,bus_organization.organization_type_id,bus_organization.mdate,bus_organization.cdate,bus_organization.deleted ";
075      $q .= " FROM bus_organization ";
076      $q .= " INNER JOIN cor_entity ON bus_organization.entity_id=cor_entity.id ";
077      $q .= is_null($__entity_id) ? "" : " AND cor_entity.id='$__entity_id' ";
078      $q .= is_null($__name) ? "" : " AND bus_organization.name='$__name' ";       
079 
080      $db->query($q);
081      if ($db->next_record() && $db->num_rows() == 1)
082      {
083          $this->_id = $db->f("id");
084          $this->_description = $db->f("description");
085          $this->_entity_type_id = $db->f("entity_type_id");
086          $this->__id = $db->f("_id");
087          $this->_entity_id = $db->f("entity_id");
088          $this->_name = $db->f("name");
089          $this->_organization_type_id = $db->f("organization_type_id");
090          $this->_mdate = $db->f("mdate");
091          $this->_cdate = $db->f("cdate");
092          $this->_deleted = $db->f("deleted");
093      }
094  }
protected staticdb ( )[ organization_db ]
Parameters
No parameters for this method
Code
382  protected static function db()
383  {
384      return new db();
385  }
publicdelete ( )[ organization_db ]
Parameters
No parameters for this method
Code
165  public function delete()
166  {
167      parent::delete();
168      $db = organization::db();
169      $q  = " UPDATE bus_organization SET ";
170      $q .= " deleted = 1 ";
171      $q .= " WHERE entity_id = " . $this->_entity_id;
172      $db->query($q);
173      $this->deleted = true;
174      return true;
175  }
public staticdelete_all ( )[ organization_db ]
Parameters
No parameters for this method
Code
277  public static function delete_all()
278  {
279      $db = organization::db();
280      $q  = " UPDATE bus_organization SET ";
281      $q .= " deleted = 1 ";
282     
283      $db->query($q);
284      return true;
285  }
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_address ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
938  public function get_address($__type="default")
939  {
940      $object = is_null(keyval($this->property_objects_array,"{$__type}_address")) ? new address($this->get_address_id($__type)) : $this->property_objects_array["{$__type}_address"];
941      $this->property_objects_array["{$__type}_address"] = $object;
942      return $object;
943  }
publicget_address_id ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
944  public function get_address_id($__type="default")
945  {
946      $ids = $this->get_address_ids($__type, true);
947      return (count($ids)==1 ? $ids[0] : null);
948  }
publicget_address_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
949  public function get_address_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
950  {
951      $address_ids = array();
952      $db = entity::db();
953      $q  = " SELECT cor_address.id FROM cor_address_entity INNER JOIN cor_address ON cor_address_entity.address_id=cor_address.id AND cor_address_entity.deleted=0 AND cor_address.deleted=0 AND cor_address_entity.entity_id='$this->id' " . (is_null($__type) ? "" : " AND cor_address_entity.address_entity_type_id='" . address_entity::type_id($__type) . "'") . ($__get_primary ? " AND cor_address_entity.primary=1 " : "");
954      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
955      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
956      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
957      $db->query($q);
958      while ($db->next_record())
959      {
960          $address_ids[] = $db->f("id");
961      }
962      return $address_ids;
963  }
publicget_address_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
964  public function get_address_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
965  {
966      $ids = $this->get_address_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
967      $objects = array();
968      foreach ($ids as $index=>$id)
969      {
970          $objects[$index] = new address($id);
971      }
972      return $objects;
973  }
publicget_array ( )[ obj ]
Parameters
No parameters for this method
Code
096  public function get_array()
097  {
098      return get_object_vars($this);
099  }
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] )[ organization_db ]
Parameters
requiredcolumns
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
199  public static function get_columns($__columns, $__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
200  {
201      $lookups = is_array($__lookups) ? $__lookups : array($__lookups);
202      $colarray = is_array($__columns) ? $__columns : explode(",",$__columns);
203      $colstring = is_array($__columns) ? implode(",",$__columns) : $__columns;
204 
205      $db = organization::db();
206      $data = array();
207      $q  = " SELECT $colstring ";
208      $q .= " FROM bus_organization ";
209      $q .= " INNER JOIN cor_entity ON bus_organization.entity_id=cor_entity.id ";
210      $q .= array_key_exists("entity_type_id",$lookups) ? " AND cor_entity.entity_type_id='" . $lookups["entity_type_id"] . "' " : "";
211      $q .= " WHERE bus_organization.deleted = 0 ";
212      $q .= is_null($__where_clause) ? null : " AND ($__where_clause) ";
213      $q .= array_key_exists("organization_type_id",$lookups) ? " AND bus_organization.organization_type_id='" . $lookups["organization_type_id"] . "' " : "";
214 
215      if (is_string($__order))
216      {
217          $q .= "ORDER BY " . $__order;
218      }
219      else if (is_array($__order) and count($__order)>0)
220      {
221          $orderings = array();
222          foreach ($__order as $col=>$dir)
223          {
224              $orderings[] = " $col $dir ";
225          }
226          $q .= "ORDER BY " . implode(", ", $orderings);
227      }
228      else if (is_object($__order))
229      {
230          $q .= "";
231      }
232      else
233      {
234          // THERE IS NO `order` COLUMN ON THIS OBJECT
235      }
236 
237      if (!is_null($__limit))
238      {
239          $q .= " LIMIT $__offset , $__limit ";
240      }
241 
242      $db->query($q);
243 
244      if (count($colarray)>1 || $colstring=="*")
245      {
246          while ($db->next_record())
247          {
248              $data[] = $db->record;
249          }
250      }
251      else
252      {
253          while ($db->next_record())
254          {
255              $data[] = $db->f(0);
256          }
257      }
258 
259      return $data;
260  }
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_document ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
1433  public function get_document($__type="default")
1434  {
1435      $object = is_null(keyval($this->property_objects_array,"{$__type}_document")) ? new document($this->get_document_id($__type)) : $this->property_objects_array["{$__type}_document"];
1436      $this->property_objects_array["{$__type}_document"] = $object;
1437      return $object;
1438  }
publicget_document_id ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
1439  public function get_document_id($__type="default")
1440  {
1441      $ids = $this->get_document_ids($__type, true);
1442      return (count($ids)==1 ? $ids[0] : null);
1443  }
publicget_document_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
1444  public function get_document_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
1445  {
1446      $document_ids = array();
1447      $db = entity::db();
1448      $q  = " SELECT doc_document.id FROM doc_document_entity INNER JOIN doc_document ON doc_document_entity.document_id=doc_document.id AND doc_document_entity.deleted=0 AND doc_document.deleted=0 AND doc_document_entity.entity_id='$this->id' " . (is_null($__type) ? "" : " AND doc_document_entity.document_entity_type_id='" . document_entity::type_id($__type) . "'") . ($__get_primary ? " AND doc_document_entity.primary=1 " : "");
1449      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
1450      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
1451      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
1452      $db->query($q);
1453      while ($db->next_record())
1454      {
1455          $document_ids[] = $db->f("id");
1456      }
1457      return $document_ids;
1458  }
publicget_document_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
1459  public function get_document_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
1460  {
1461      $ids = $this->get_document_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
1462      $objects = array();
1463      foreach ($ids as $index=>$id)
1464      {
1465          $objects[$index] = new document($id);
1466      }
1467      return $objects;
1468  }
publicget_email ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
1037  public function get_email($__type="default")
1038  {
1039      $object = is_null(keyval($this->property_objects_array,"{$__type}_email")) ? new email($this->get_email_id($__type)) : $this->property_objects_array["{$__type}_email"];
1040      $this->property_objects_array["{$__type}_email"] = $object;
1041      return $object;
1042  }
publicget_email_id ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
1043  public function get_email_id($__type="default")
1044  {
1045      $ids = $this->get_email_ids($__type, true);
1046      return (count($ids)==1 ? $ids[0] : null);
1047  }
publicget_email_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
1048  public function get_email_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
1049  {
1050      $email_ids = array();
1051      $db = entity::db();
1052      $q  = " SELECT cor_email.id FROM cor_email_entity INNER JOIN cor_email ON cor_email_entity.email_id=cor_email.id AND cor_email_entity.deleted=0 AND cor_email.deleted=0 AND cor_email_entity.entity_id='$this->id' " . (is_null($__type) ? "" : " AND cor_email_entity.email_entity_type_id='" . email_entity::type_id($__type) . "'") . ($__get_primary ? " AND cor_email_entity.primary=1 " : "");
1053      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
1054      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
1055      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
1056      $db->query($q);
1057      while ($db->next_record())
1058      {
1059          $email_ids[] = $db->f("id");
1060      }
1061      return $email_ids;
1062  }
publicget_email_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
1063  public function get_email_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
1064  {
1065      $ids = $this->get_email_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
1066      $objects = array();
1067      foreach ($ids as $index=>$id)
1068      {
1069          $objects[$index] = new email($id);
1070      }
1071      return $objects;
1072  }
publicget_entity ( )[ organization_db ]
Parameters
No parameters for this method
Code
358  public function get_entity()
359  {
360      return new entity($this->entity_id);
361  }
publicget_entity_type ( )[ entity_db ]
Parameters
No parameters for this method
Code
332  public function get_entity_type()
333  {
334      return new entity_type($this->entity_type_id);
335  }
publicget_event ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
542  public function get_event($__type="default")
543  {
544      $object = is_null(keyval($this->property_objects_array,"{$__type}_event")) ? new event($this->get_event_id($__type)) : $this->property_objects_array["{$__type}_event"];
545      $this->property_objects_array["{$__type}_event"] = $object;
546      return $object;
547  }
publicget_event_id ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
548  public function get_event_id($__type="default")
549  {
550      $ids = $this->get_event_ids($__type, true);
551      return (count($ids)==1 ? $ids[0] : null);
552  }
publicget_event_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
553  public function get_event_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
554  {
555      $event_ids = array();
556      $db = entity::db();
557      $q  = " SELECT cal_event.id FROM cal_entity_event INNER JOIN cal_event ON cal_entity_event.event_id=cal_event.id AND cal_entity_event.deleted=0 AND cal_event.deleted=0 AND cal_entity_event.entity_id='$this->id' " . (is_null($__type) ? "" : " AND cal_entity_event.entity_event_type_id='" . entity_event::type_id($__type) . "'") . ($__get_primary ? " AND cal_entity_event.primary=1 " : "");
558      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
559      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
560      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
561      $db->query($q);
562      while ($db->next_record())
563      {
564          $event_ids[] = $db->f("id");
565      }
566      return $event_ids;
567  }
publicget_event_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
568  public function get_event_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
569  {
570      $ids = $this->get_event_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
571      $objects = array();
572      foreach ($ids as $index=>$id)
573      {
574          $objects[$index] = new event($id);
575      }
576      return $objects;
577  }
public staticget_ids ( order , lookups , where_clause , limit , offset [0] )[ organization_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
262  public static function get_ids($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
263  {
264      return organization::get_columns("entity_id", $__order, $__lookups, $__where_clause, $__limit, $__offset);
265  }
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  }
publicget_menu ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
1532  public function get_menu($__type="default")
1533  {
1534      $object = is_null(keyval($this->property_objects_array,"{$__type}_menu")) ? new menu($this->get_menu_id($__type)) : $this->property_objects_array["{$__type}_menu"];
1535      $this->property_objects_array["{$__type}_menu"] = $object;
1536      return $object;
1537  }
publicget_menu_id ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
1538  public function get_menu_id($__type="default")
1539  {
1540      $ids = $this->get_menu_ids($__type, true);
1541      return (count($ids)==1 ? $ids[0] : null);
1542  }
publicget_menu_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
1543  public function get_menu_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
1544  {
1545      $menu_ids = array();
1546      $db = entity::db();
1547      $q  = " SELECT ifc_menu.id FROM ifc_entity_menu INNER JOIN ifc_menu ON ifc_entity_menu.menu_id=ifc_menu.id AND ifc_entity_menu.deleted=0 AND ifc_menu.deleted=0 AND ifc_entity_menu.entity_id='$this->id' " . (is_null($__type) ? "" : " AND ifc_entity_menu.entity_menu_type_id='" . entity_menu::type_id($__type) . "'") . ($__get_primary ? " AND ifc_entity_menu.primary=1 " : "");
1548      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
1549      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
1550      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
1551      $db->query($q);
1552      while ($db->next_record())
1553      {
1554          $menu_ids[] = $db->f("id");
1555      }
1556      return $menu_ids;
1557  }
publicget_menu_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
1558  public function get_menu_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
1559  {
1560      $ids = $this->get_menu_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
1561      $objects = array();
1562      foreach ($ids as $index=>$id)
1563      {
1564          $objects[$index] = new menu($id);
1565      }
1566      return $objects;
1567  }
public staticget_objects ( order , lookups , where_clause , limit , offset [0] )[ organization_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
267  public static function get_objects($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
268  {
269      $objects = array();
270      foreach (organization::get_columns("entity_id", $__order, $__lookups, $__where_clause, $__limit, $__offset) as $id)
271      {
272          $objects[] = new organization($id);
273      }
274      return $objects;
275  }
publicget_order ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
641  public function get_order($__type="default")
642  {
643      $object = is_null(keyval($this->property_objects_array,"{$__type}_order")) ? new order($this->get_order_id($__type)) : $this->property_objects_array["{$__type}_order"];
644      $this->property_objects_array["{$__type}_order"] = $object;
645      return $object;
646  }
publicget_order_id ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
647  public function get_order_id($__type="default")
648  {
649      $ids = $this->get_order_ids($__type, true);
650      return (count($ids)==1 ? $ids[0] : null);
651  }
publicget_order_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
652  public function get_order_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
653  {
654      $order_ids = array();
655      $db = entity::db();
656      $q  = " SELECT com_order.id FROM com_entity_order INNER JOIN com_order ON com_entity_order.order_id=com_order.id AND com_entity_order.deleted=0 AND com_order.deleted=0 AND com_entity_order.entity_id='$this->id' " . (is_null($__type) ? "" : " AND com_entity_order.entity_order_type_id='" . entity_order::type_id($__type) . "'") . ($__get_primary ? " AND com_entity_order.primary=1 " : "");
657      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
658      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
659      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
660      $db->query($q);
661      while ($db->next_record())
662      {
663          $order_ids[] = $db->f("id");
664      }
665      return $order_ids;
666  }
publicget_order_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
667  public function get_order_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
668  {
669      $ids = $this->get_order_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
670      $objects = array();
671      foreach ($ids as $index=>$id)
672      {
673          $objects[$index] = new order($id);
674      }
675      return $objects;
676  }
publicget_orders ( )[ entity_ext ]
Parameters
No parameters for this method
Code
008  public function get_orders()
009  {
010      return $this->order_list;
011  }
publicget_organization_type ( )[ organization_db ]
Parameters
No parameters for this method
Code
370  public function get_organization_type()
371  {
372      return new organization_type($this->organization_type_id);
373  }
publicget_orgchart ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
443  public function get_orgchart($__type="default")
444  {
445      $object = is_null(keyval($this->property_objects_array,"{$__type}_orgchart")) ? new orgchart($this->get_orgchart_id($__type)) : $this->property_objects_array["{$__type}_orgchart"];
446      $this->property_objects_array["{$__type}_orgchart"] = $object;
447      return $object;
448  }
publicget_orgchart_id ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
449  public function get_orgchart_id($__type="default")
450  {
451      $ids = $this->get_orgchart_ids($__type, true);
452      return (count($ids)==1 ? $ids[0] : null);
453  }
publicget_orgchart_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
454  public function get_orgchart_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
455  {
456      $orgchart_ids = array();
457      $db = entity::db();
458      $q  = " SELECT bus_orgchart.id FROM bus_entity_orgchart INNER JOIN bus_orgchart ON bus_entity_orgchart.orgchart_id=bus_orgchart.id AND bus_entity_orgchart.deleted=0 AND bus_orgchart.deleted=0 AND bus_entity_orgchart.entity_id='$this->id' " . (is_null($__type) ? "" : " AND bus_entity_orgchart.entity_orgchart_type_id='" . entity_orgchart::type_id($__type) . "'") . ($__get_primary ? " AND bus_entity_orgchart.primary=1 " : "");
459      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
460      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
461      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
462      $db->query($q);
463      while ($db->next_record())
464      {
465          $orgchart_ids[] = $db->f("id");
466      }
467      return $orgchart_ids;
468  }
publicget_orgchart_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
469  public function get_orgchart_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
470  {
471      $ids = $this->get_orgchart_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
472      $objects = array();
473      foreach ($ids as $index=>$id)
474      {
475          $objects[$index] = new orgchart($id);
476      }
477      return $objects;
478  }
publicget_orgposition ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
344  public function get_orgposition($__type="default")
345  {
346      $object = is_null(keyval($this->property_objects_array,"{$__type}_orgposition")) ? new orgposition($this->get_orgposition_id($__type)) : $this->property_objects_array["{$__type}_orgposition"];
347      $this->property_objects_array["{$__type}_orgposition"] = $object;
348      return $object;
349  }
publicget_orgposition_id ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
350  public function get_orgposition_id($__type="default")
351  {
352      $ids = $this->get_orgposition_ids($__type, true);
353      return (count($ids)==1 ? $ids[0] : null);
354  }
publicget_orgposition_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
355  public function get_orgposition_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
356  {
357      $orgposition_ids = array();
358      $db = entity::db();
359      $q  = " SELECT bus_orgposition.id FROM bus_entity_orgposition INNER JOIN bus_orgposition ON bus_entity_orgposition.orgposition_id=bus_orgposition.id AND bus_entity_orgposition.deleted=0 AND bus_orgposition.deleted=0 AND bus_entity_orgposition.entity_id='$this->id' " . (is_null($__type) ? "" : " AND bus_entity_orgposition.entity_orgposition_type_id='" . entity_orgposition::type_id($__type) . "'") . ($__get_primary ? " AND bus_entity_orgposition.primary=1 " : "");
360      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
361      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
362      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
363      $db->query($q);
364      while ($db->next_record())
365      {
366          $orgposition_ids[] = $db->f("id");
367      }
368      return $orgposition_ids;
369  }
publicget_orgposition_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
370  public function get_orgposition_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
371  {
372      $ids = $this->get_orgposition_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
373      $objects = array();
374      foreach ($ids as $index=>$id)
375      {
376          $objects[$index] = new orgposition($id);
377      }
378      return $objects;
379  }
publicget_payment ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
740  public function get_payment($__type="default")
741  {
742      $object = is_null(keyval($this->property_objects_array,"{$__type}_payment")) ? new payment($this->get_payment_id($__type)) : $this->property_objects_array["{$__type}_payment"];
743      $this->property_objects_array["{$__type}_payment"] = $object;
744      return $object;
745  }
publicget_payment_id ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
746  public function get_payment_id($__type="default")
747  {
748      $ids = $this->get_payment_ids($__type, true);
749      return (count($ids)==1 ? $ids[0] : null);
750  }
publicget_payment_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
751  public function get_payment_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
752  {
753      $payment_ids = array();
754      $db = entity::db();
755      $q  = " SELECT com_payment.id FROM com_entity_payment INNER JOIN com_payment ON com_entity_payment.payment_id=com_payment.id AND com_entity_payment.deleted=0 AND com_payment.deleted=0 AND com_entity_payment.entity_id='$this->id' " . (is_null($__type) ? "" : " AND com_entity_payment.entity_payment_type_id='" . entity_payment::type_id($__type) . "'") . ($__get_primary ? " AND com_entity_payment.primary=1 " : "");
756      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
757      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
758      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
759      $db->query($q);
760      while ($db->next_record())
761      {
762          $payment_ids[] = $db->f("id");
763      }
764      return $payment_ids;
765  }
publicget_payment_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
766  public function get_payment_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
767  {
768      $ids = $this->get_payment_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
769      $objects = array();
770      foreach ($ids as $index=>$id)
771      {
772          $objects[$index] = new payment($id);
773      }
774      return $objects;
775  }
publicget_paymentaccount ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
839  public function get_paymentaccount($__type="default")
840  {
841      $object = is_null(keyval($this->property_objects_array,"{$__type}_paymentaccount")) ? new paymentaccount($this->get_paymentaccount_id($__type)) : $this->property_objects_array["{$__type}_paymentaccount"];
842      $this->property_objects_array["{$__type}_paymentaccount"] = $object;
843      return $object;
844  }
publicget_paymentaccount_id ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
845  public function get_paymentaccount_id($__type="default")
846  {
847      $ids = $this->get_paymentaccount_ids($__type, true);
848      return (count($ids)==1 ? $ids[0] : null);
849  }
publicget_paymentaccount_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
850  public function get_paymentaccount_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
851  {
852      $paymentaccount_ids = array();
853      $db = entity::db();
854      $q  = " SELECT com_paymentaccount.id FROM com_entity_paymentaccount INNER JOIN com_paymentaccount ON com_entity_paymentaccount.paymentaccount_id=com_paymentaccount.id AND com_entity_paymentaccount.deleted=0 AND com_paymentaccount.deleted=0 AND com_entity_paymentaccount.entity_id='$this->id' " . (is_null($__type) ? "" : " AND com_entity_paymentaccount.entity_paymentaccount_type_id='" . entity_paymentaccount::type_id($__type) . "'") . ($__get_primary ? " AND com_entity_paymentaccount.primary=1 " : "");
855      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
856      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
857      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
858      $db->query($q);
859      while ($db->next_record())
860      {
861          $paymentaccount_ids[] = $db->f("id");
862      }
863      return $paymentaccount_ids;
864  }
publicget_paymentaccount_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
865  public function get_paymentaccount_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
866  {
867      $ids = $this->get_paymentaccount_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
868      $objects = array();
869      foreach ($ids as $index=>$id)
870      {
871          $objects[$index] = new paymentaccount($id);
872      }
873      return $objects;
874  }
publicget_phone ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
1135  public function get_phone($__type="default")
1136  {
1137      $object = is_null(keyval($this->property_objects_array,"{$__type}_phone")) ? new phone($this->get_phone_id($__type)) : $this->property_objects_array["{$__type}_phone"];
1138      $this->property_objects_array["{$__type}_phone"] = $object;
1139      return $object;
1140  }
publicget_phone_id ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
1141  public function get_phone_id($__type="default")
1142  {
1143      $ids = $this->get_phone_ids($__type, true);
1144      return (count($ids)==1 ? $ids[0] : null);
1145  }
publicget_phone_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
1146  public function get_phone_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
1147  {
1148      $phone_ids = array();
1149      $db = entity::db();
1150      $q  = " SELECT cor_phone.id FROM cor_entity_phone INNER JOIN cor_phone ON cor_entity_phone.phone_id=cor_phone.id AND cor_entity_phone.deleted=0 AND cor_phone.deleted=0 AND cor_entity_phone.entity_id='$this->id' " . (is_null($__type) ? "" : " AND cor_entity_phone.entity_phone_type_id='" . entity_phone::type_id($__type) . "'") . ($__get_primary ? " AND cor_entity_phone.primary=1 " : "");
1151      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
1152      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
1153      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
1154      $db->query($q);
1155      while ($db->next_record())
1156      {
1157          $phone_ids[] = $db->f("id");
1158      }
1159      return $phone_ids;
1160  }
publicget_phone_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
1161  public function get_phone_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
1162  {
1163      $ids = $this->get_phone_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
1164      $objects = array();
1165      foreach ($ids as $index=>$id)
1166      {
1167          $objects[$index] = new phone($id);
1168      }
1169      return $objects;
1170  }
publicget_projectentity ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
1631  public function get_projectentity($__type="default")
1632  {
1633      $object = is_null(keyval($this->property_objects_array,"{$__type}_projectentity")) ? new projectentity($this->get_projectentity_id($__type)) : $this->property_objects_array["{$__type}_projectentity"];
1634      $this->property_objects_array["{$__type}_projectentity"] = $object;
1635      return $object;
1636  }
publicget_projectentity_id ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
1637  public function get_projectentity_id($__type="default")
1638  {
1639      $ids = $this->get_projectentity_ids($__type, true);
1640      return (count($ids)==1 ? $ids[0] : null);
1641  }
publicget_projectentity_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
1642  public function get_projectentity_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
1643  {
1644      $projectentity_ids = array();
1645      $db = entity::db();
1646      $q  = " SELECT prj_projectentity.id FROM prj_entity_projectentity INNER JOIN prj_projectentity ON prj_entity_projectentity.projectentity_id=prj_projectentity.id AND prj_entity_projectentity.deleted=0 AND prj_projectentity.deleted=0 AND prj_entity_projectentity.entity_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 " : "");
1647      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
1648      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
1649      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
1650      $db->query($q);
1651      while ($db->next_record())
1652      {
1653          $projectentity_ids[] = $db->f("id");
1654      }
1655      return $projectentity_ids;
1656  }
publicget_projectentity_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
1657  public function get_projectentity_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
1658  {
1659      $ids = $this->get_projectentity_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
1660      $objects = array();
1661      foreach ($ids as $index=>$id)
1662      {
1663          $objects[$index] = new projectentity($id);
1664      }
1665      return $objects;
1666  }
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"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
1234  public function get_resource($__type="default")
1235  {
1236      $object = is_null(keyval($this->property_objects_array,"{$__type}_resource")) ? new resource($this->get_resource_id($__type)) : $this->property_objects_array["{$__type}_resource"];
1237      $this->property_objects_array["{$__type}_resource"] = $object;
1238      return $object;
1239  }
publicget_resource_id ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
1240  public function get_resource_id($__type="default")
1241  {
1242      $ids = $this->get_resource_ids($__type, true);
1243      return (count($ids)==1 ? $ids[0] : null);
1244  }
publicget_resource_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
1245  public function get_resource_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
1246  {
1247      $resource_ids = array();
1248      $db = entity::db();
1249      $q  = " SELECT cor_resource.id FROM cor_entity_resource INNER JOIN cor_resource ON cor_entity_resource.resource_id=cor_resource.id AND cor_entity_resource.deleted=0 AND cor_resource.deleted=0 AND cor_entity_resource.entity_id='$this->id' " . (is_null($__type) ? "" : " AND cor_entity_resource.entity_resource_type_id='" . entity_resource::type_id($__type) . "'") . ($__get_primary ? " AND cor_entity_resource.primary=1 " : "");
1250      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
1251      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
1252      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
1253      $db->query($q);
1254      while ($db->next_record())
1255      {
1256          $resource_ids[] = $db->f("id");
1257      }
1258      return $resource_ids;
1259  }
publicget_resource_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
1260  public function get_resource_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
1261  {
1262      $ids = $this->get_resource_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
1263      $objects = array();
1264      foreach ($ids as $index=>$id)
1265      {
1266          $objects[$index] = new resource($id);
1267      }
1268      return $objects;
1269  }
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"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
1730  public function get_task($__type="default")
1731  {
1732      $object = is_null(keyval($this->property_objects_array,"{$__type}_task")) ? new task($this->get_task_id($__type)) : $this->property_objects_array["{$__type}_task"];
1733      $this->property_objects_array["{$__type}_task"] = $object;
1734      return $object;
1735  }
publicget_task_id ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
1736  public function get_task_id($__type="default")
1737  {
1738      $ids = $this->get_task_ids($__type, true);
1739      return (count($ids)==1 ? $ids[0] : null);
1740  }
publicget_task_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
1741  public function get_task_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
1742  {
1743      $task_ids = array();
1744      $db = entity::db();
1745      $q  = " SELECT prj_task.id FROM prj_entity_task INNER JOIN prj_task ON prj_entity_task.task_id=prj_task.id AND prj_entity_task.deleted=0 AND prj_task.deleted=0 AND prj_entity_task.entity_id='$this->id' " . (is_null($__type) ? "" : " AND prj_entity_task.entity_task_type_id='" . entity_task::type_id($__type) . "'") . ($__get_primary ? " AND prj_entity_task.primary=1 " : "");
1746      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
1747      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
1748      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
1749      $db->query($q);
1750      while ($db->next_record())
1751      {
1752          $task_ids[] = $db->f("id");
1753      }
1754      return $task_ids;
1755  }
publicget_task_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
1756  public function get_task_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
1757  {
1758      $ids = $this->get_task_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
1759      $objects = array();
1760      foreach ($ids as $index=>$id)
1761      {
1762          $objects[$index] = new task($id);
1763      }
1764      return $objects;
1765  }
publicget_type ( )[ organization_db ]
Parameters
No parameters for this method
Code
347  public function get_type()
348  {
349      $type = new organization_type($this->_organization_type_id);
350      return $type->name;
351  }
publicget_url ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
1335  public function get_url($__type="default")
1336  {
1337      $object = is_null(keyval($this->property_objects_array,"{$__type}_url")) ? new url($this->get_url_id($__type)) : $this->property_objects_array["{$__type}_url"];
1338      $this->property_objects_array["{$__type}_url"] = $object;
1339      return $object;
1340  }
publicget_url_id ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
1341  public function get_url_id($__type="default")
1342  {
1343      $ids = $this->get_url_ids($__type, true);
1344      return (count($ids)==1 ? $ids[0] : null);
1345  }
publicget_url_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
1346  public function get_url_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
1347  {
1348      $url_ids = array();
1349      $db = entity::db();
1350      $q  = " SELECT cor_url.id FROM cor_entity_url INNER JOIN cor_url ON cor_entity_url.url_id=cor_url.id AND cor_entity_url.deleted=0 AND cor_url.deleted=0 AND cor_entity_url.entity_id='$this->id' " . (is_null($__type) ? "" : " AND cor_entity_url.entity_url_type_id='" . entity_url::type_id($__type) . "'") . ($__get_primary ? " AND cor_entity_url.primary=1 " : "");
1351      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
1352      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
1353      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
1354      $db->query($q);
1355      while ($db->next_record())
1356      {
1357          $url_ids[] = $db->f("id");
1358      }
1359      return $url_ids;
1360  }
publicget_url_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
1361  public function get_url_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
1362  {
1363      $ids = $this->get_url_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
1364      $objects = array();
1365      foreach ($ids as $index=>$id)
1366      {
1367          $objects[$index] = new url($id);
1368      }
1369      return $objects;
1370  }
publicget_video ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
1829  public function get_video($__type="default")
1830  {
1831      $object = is_null(keyval($this->property_objects_array,"{$__type}_video")) ? new video($this->get_video_id($__type)) : $this->property_objects_array["{$__type}_video"];
1832      $this->property_objects_array["{$__type}_video"] = $object;
1833      return $object;
1834  }
publicget_video_id ( type ["default"] )[ entity_db ]
Parameters
optionaltype ["default"]
Code
1835  public function get_video_id($__type="default")
1836  {
1837      $ids = $this->get_video_ids($__type, true);
1838      return (count($ids)==1 ? $ids[0] : null);
1839  }
publicget_video_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
1840  public function get_video_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
1841  {
1842      $video_ids = array();
1843      $db = entity::db();
1844      $q  = " SELECT vid_video.id FROM vid_entity_video INNER JOIN vid_video ON vid_entity_video.video_id=vid_video.id AND vid_entity_video.deleted=0 AND vid_video.deleted=0 AND vid_entity_video.entity_id='$this->id' " . (is_null($__type) ? "" : " AND vid_entity_video.entity_video_type_id='" . entity_video::type_id($__type) . "'") . ($__get_primary ? " AND vid_entity_video.primary=1 " : "");
1845      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
1846      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
1847      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
1848      $db->query($q);
1849      while ($db->next_record())
1850      {
1851          $video_ids[] = $db->f("id");
1852      }
1853      return $video_ids;
1854  }
publicget_video_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ entity_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
1855  public function get_video_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
1856  {
1857      $ids = $this->get_video_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
1858      $objects = array();
1859      foreach ($ids as $index=>$id)
1860      {
1861          $objects[$index] = new video($id);
1862      }
1863      return $objects;
1864  }
protectedinsert ( )[ organization_db ]
Parameters
No parameters for this method
Code
126  protected function insert()
127  {
128      parent::insert();
129      $this->_entity_id = $this->id;
130      $db = organization::db();
131      $q  = " INSERT INTO bus_organization ( ";
132      $q .= $db->param_string("entity_id") . ", ";
133      $q .= $db->param_string("name") . ", ";
134      $q .= $db->param_string("organization_type_id") . ", ";
135      $q .= $db->param_string("mdate") . ", ";
136      $q .= $db->param_string("cdate") . ", ";
137      $q .= $db->param_string("deleted");
138      $q .= " ) VALUES ( ";
139      $q .= $db->value_string($this->_entity_id) . ", ";
140      $q .= $db->value_string($this->_name) . ", ";
141      $q .= $db->value_string($this->_organization_type_id) . ", ";
142      $q .= $db->value_string(timestamp()) . ", ";
143      $q .= $db->value_string(timestamp()) . ", ";
144      $q .= $this->deleted ? "'1'" : "'0'";
145      $q .= " ) ";
146      $db->query($q);
147      return true;
148  }
publicmap ( )[ organization_db ]
Parameters
No parameters for this method
Code
096  public function map()
097  {
098      $this->_description = array_key_exists("organization:description",$_REQUEST) ? reqval("organization:description") : $this->_description;
099      $this->_entity_type_id = array_key_exists("organization:entity_type_id",$_REQUEST) ? reqval("organization:entity_type_id") : $this->_entity_type_id;
100      $this->_name = array_key_exists("organization:name",$_REQUEST) ? reqval("organization:name") : $this->_name;
101      $this->_organization_type_id = array_key_exists("organization:organization_type_id",$_REQUEST) ? reqval("organization:organization_type_id") : $this->_organization_type_id;
102      $this->_mdate = array_key_exists("organization:mdate",$_REQUEST) ? reqval("organization:mdate") : $this->_mdate;
103      $this->_cdate = array_key_exists("organization:cdate",$_REQUEST) ? reqval("organization:cdate") : $this->_cdate;
104      $this->_deleted = array_key_exists("organization:deleted",$_REQUEST) ? reqval("organization:deleted") : $this->_deleted;
105  }
publicpurge ( )[ organization_db ]
Parameters
No parameters for this method
Code
189  public function purge()
190  {
191      parent::purge();
192      $db = organization::db();
193      $q  = " DELETE FROM bus_organization ";
194      $q .= " WHERE entity_id = " . $this->_entity_id;
195      $db->query($q);
196      return true;
197  }
public staticsearch ( keyword )[ organization_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_address ( v , type ["default"] )[ entity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
975  public function set_address($__v, $__type="default")
976  {
977      $object = is_null(keyval($this->property_objects_array,"{$__type}_address")) ? new address($this->get_address_id($__type)) : $this->property_objects_array["{$__type}_address"];
978      if (is_null($__v))
979      {
980          $rel = new address_entity(null,$object->id,$this->id,address_entity::type_id($__type));
981          $rel->delete();
982          if (!is_null(keyval($this->property_objects_array,"{$__type}_address")))
983          {
984              $this->property_objects_array["{$__type}_address"] = null;
985          }
986      }
987      else
988      {
989          $id = $object->id;
990          $object = $__v;
991          $object->id = $__v->id>0 ? $__v->id : $id;
992          $object->commit();
993          $this->set_address_ids(array($object->id),$__type);
994      }
995  }
publicset_address_id ( v , type ["default"] )[ entity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
996  public function set_address_id($__v, $__type="default")
997  {
998      $this->set_address_ids(array($__v),$__type);
999  }
publicset_address_ids ( v , type ["default"] )[ entity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1000  public function set_address_ids($__v, $__type="default")
1001  {
1002      if ($this->id == 0)
1003      {
1004          $this->commit();
1005      }
1006      $type_id = address_entity::type_id($__type);
1007      address_entity::delete_all(null,$this->id,$type_id);
1008      if (is_array($__v))
1009      {
1010          foreach ($__v as $index=>$id)
1011          {
1012              $object = new address_entity(null,$id,$this->id,$type_id);
1013              $object->deleted = false;
1014              $object->address_entity_type_id = $type_id;
1015              $object->commit();
1016              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_address")))
1017              {
1018                  $this->property_objects_array["{$__type}_address"] = new address($object->address_id);
1019              }
1020          }
1021          $this->_dirty = true;
1022      }
1023  }
publicset_address_list ( v , type ["default"] )[ entity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1024  public function set_address_list($__v, $__type="default")
1025  {
1026      if (is_array($__v))
1027      {
1028          $ids = array();
1029          foreach ($__v as $index=>$object)
1030          {
1031              $ids[] = $object->id;
1032          }
1033          $this->set_address_ids($ids,$__type);
1034      }
1035  }
publicset_document ( v , type ["default"] )[ entity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1470  public function set_document($__v, $__type="default")
1471  {
1472      $object = is_null(keyval($this->property_objects_array,"{$__type}_document")) ? new document($this->get_document_id($__type)) : $this->property_objects_array["{$__type}_document"];
1473      if (is_null($__v))
1474      {
1475          $rel = new document_entity(null,$object->id,$this->id,document_entity::type_id($__type));
1476          $rel->delete();
1477          if (!is_null(keyval($this->property_objects_array,"{$__type}_document")))
1478          {
1479              $this->property_objects_array["{$__type}_document"] = null;
1480          }
1481      }
1482      else
1483      {
1484          $id = $object->id;
1485          $object = $__v;
1486          $object->id = $__v->id>0 ? $__v->id : $id;
1487          $object->commit();
1488          $this->set_document_ids(array($object->id),$__type);
1489      }
1490  }
publicset_document_id ( v , type ["default"] )[ entity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1491  public function set_document_id($__v, $__type="default")
1492  {
1493      $this->set_document_ids(array($__v),$__type);
1494  }
publicset_document_ids ( v , type ["default"] )[ entity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1495  public function set_document_ids($__v, $__type="default")
1496  {
1497      if ($this->id == 0)
1498      {
1499          $this->commit();
1500      }
1501      $type_id = document_entity::type_id($__type);
1502      document_entity::delete_all(null,$this->id,$type_id);
1503      if (is_array($__v))
1504      {
1505          foreach ($__v as $index=>$id)
1506          {
1507              $object = new document_entity(null,$id,$this->id,$type_id);
1508              $object->deleted = false;
1509              $object->document_entity_type_id = $type_id;
1510              $object->commit();
1511              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_document")))
1512              {
1513                  $this->property_objects_array["{$__type}_document"] = new document($object->document_id);
1514              }
1515          }
1516          $this->_dirty = true;
1517      }
1518  }
publicset_document_list ( v , type ["default"] )[ entity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1519  public function set_document_list($__v, $__type="default")
1520  {
1521      if (is_array($__v))
1522      {
1523          $ids = array();
1524          foreach ($__v as $index=>$object)
1525          {
1526              $ids[] = $object->id;
1527          }
1528          $this->set_document_ids($ids,$__type);
1529      }
1530  }
publicset_email ( v , type ["default"] )[ entity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1074  public function set_email($__v, $__type="default")
1075  {
1076      $object = is_null(keyval($this->property_objects_array,"{$__type}_email")) ? new email($this->get_email_id($__type)) : $this->property_objects_array["{$__type}_email"];
1077      if (is_null($__v))
1078      {
1079          $rel = new email_entity(null,$object->id,$this->id,email_entity::type_id($__type));
1080          $rel->delete();
1081          $object->delete();
1082          if (!is_null(keyval($this->property_objects_array,"{$__type}_email")))
1083          {
1084              $this->property_objects_array["{$__type}_email"] = null;
1085          }
1086      }
1087      else
1088      {
1089          $object->value = is_object($__v) ? $__v->value : $__v;
1090          $object->commit();
1091          $this->set_email_ids(array($object->id),$__type);
1092      }
1093  }
publicset_email_id ( v , type ["default"] )[ entity_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1094  public function set_email_id($__v, $__type="default")
1095  {
1096      $this->set_email_ids(array($__v),$__type);
1097  }
publicset_email_ids ( v , type ["default"] )[ entity_db