Helix Installation   Getting Started   Reference Documentation   Global Functions   Quick Start
ModulesClassesFunctions
 

Class Reference

class order extends order_ext

Hide Inherited MembersE-Commerce
Description
No description.
 
Constants
constantTABLENAME ["com_order"][ order ]
 
Properties
protected_cdate[ order_db ]
protected_cdate_dirty[ order_db ]
protected_deleted[ order_db ]
protected_deleted_dirty[ order_db ]
protected_description[ order_db ]
protected_description_dirty[ order_db ]
protected_dirty[ obj ]
protected_discount[ order_db ]
protected_discount_dirty[ order_db ]
protected_id[ order_db ]
protected_id_dirty[ order_db ]
protected_mdate[ order_db ]
protected_mdate_dirty[ order_db ]
protected_orderstatus_id[ order_db ]
protected_orderstatus_id_dirty[ order_db ]
publicproperty_objects_array[ obj ]
protected_shipping[ order_db ]
protected_shipping_dirty[ order_db ]
protected_tax[ order_db ]
protected_tax_dirty[ order_db ]
 
Methods
publiccommit ( )[ order_db ]
Parameters
No parameters for this method
Code
110  public function commit()
111  {
112      if ($this->_id > 0)
113      {
114          $this->update();
115      }
116      else
117      {
118          $this->insert();
119      }
120 
121      foreach ($this->property_objects_array as $property=>$object)
122      {
123          $this->{$property} = $object;
124      }
125 
126      return true;
127  }
public__construct ( id )[ order_db ]
Parameters
optionalid
Code
048  public function __construct($__id=null)
049  {
050      $this->_id = 0;
051      $this->_description = "";
052      $this->_tax = 0;
053      $this->_shipping = 0;
054      $this->_discount = 0;
055      $this->_orderstatus_id = 0;
056      $this->_mdate = null;
057      $this->_cdate = null;
058      $this->_deleted = false;
059 
060      $this->_id_dirty = false;
061      $this->_description_dirty = false;
062      $this->_tax_dirty = false;
063      $this->_shipping_dirty = false;
064      $this->_discount_dirty = false;
065      $this->_orderstatus_id_dirty = false;
066      $this->_mdate_dirty = false;
067      $this->_cdate_dirty = false;
068      $this->_deleted_dirty = false;
069 
070      if (is_null($__id))
071      {
072          return;
073      }
074 
075      $db = order::db();
076      $q  = " SELECT com_order.id,com_order.description,com_order.tax,com_order.shipping,com_order.discount,com_order.orderstatus_id,com_order.mdate,com_order.cdate,com_order.deleted ";
077      $q .= " FROM com_order ";       
078      if (!is_null($__id))
079      {
080          $q .= " WHERE id = '$__id' ";
081      }
082 
083      $db->query($q);
084      if ($db->next_record() && $db->num_rows() == 1)
085      {
086          $this->_id = $db->f("id");
087          $this->_description = $db->f("description");
088          $this->_tax = $db->f("tax");
089          $this->_shipping = $db->f("shipping");
090          $this->_discount = $db->f("discount");
091          $this->_orderstatus_id = $db->f("orderstatus_id");
092          $this->_mdate = $db->f("mdate");
093          $this->_cdate = $db->f("cdate");
094          $this->_deleted = $db->f("deleted");
095      }
096  }
protected staticdb ( )[ order_db ]
Parameters
No parameters for this method
Code
651  protected static function db()
652  {
653      return new db();
654  }
publicdelete ( )[ order_db ]
Parameters
No parameters for this method
Code
172  public function delete()
173  {
174      $db = order::db();
175      $q  = " UPDATE com_order SET ";
176      $q .= " deleted = 1 ";
177      $q .= " WHERE id = " . $this->_id;
178      $db->query($q);
179      $this->deleted = true;
180      return true;
181  }
public staticdelete_all ( )[ order_db ]
Parameters
No parameters for this method
Code
279  public static function delete_all()
280  {
281      $db = order::db();
282      $q  = " UPDATE com_order SET ";
283      $q .= " deleted = 1 ";
284     
285      $db->query($q);
286      return true;
287  }
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_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] )[ order_db ]
Parameters
requiredcolumns
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
203  public static function get_columns($__columns, $__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
204  {
205      $lookups = is_array($__lookups) ? $__lookups : array($__lookups);
206      $colarray = is_array($__columns) ? $__columns : explode(",",$__columns);
207      $colstring = is_array($__columns) ? implode(",",$__columns) : $__columns;
208 
209      $db = order::db();
210      $data = array();
211      $q  = " SELECT $colstring ";
212      $q .= " FROM com_order ";
213      $q .= " WHERE com_order.deleted = 0 ";
214      $q .= is_null($__where_clause) ? null : " AND ($__where_clause) ";
215      $q .= array_key_exists("orderstatus_id",$lookups) ? " AND com_order.orderstatus_id='" . $lookups["orderstatus_id"] . "' " : "";
216 
217      if (is_string($__order))
218      {
219          $q .= "ORDER BY " . $__order;
220      }
221      else if (is_array($__order) and count($__order)>0)
222      {
223          $orderings = array();
224          foreach ($__order as $col=>$dir)
225          {
226              $orderings[] = " $col $dir ";
227          }
228          $q .= "ORDER BY " . implode(", ", $orderings);
229      }
230      else if (is_object($__order))
231      {
232          $q .= "";
233      }
234      else
235      {
236          // THERE IS NO `order` COLUMN ON THIS OBJECT
237      }
238 
239      if (!is_null($__limit))
240      {
241          $q .= " LIMIT $__offset , $__limit ";
242      }
243 
244      $db->query($q);
245 
246      if (count($colarray)>1 || $colstring=="*")
247      {
248          while ($db->next_record())
249          {
250              $data[] = $db->record;
251          }
252      }
253      else
254      {
255          while ($db->next_record())
256          {
257              $data[] = $db->f(0);
258          }
259      }
260 
261      return $data;
262  }
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_entity ( type ["default"] )[ order_db ]
Parameters
optionaltype ["default"]
Code
354  public function get_entity($__type="default")
355  {
356      $object = is_null(keyval($this->property_objects_array,"{$__type}_entity")) ? new entity($this->get_entity_id($__type)) : $this->property_objects_array["{$__type}_entity"];
357      $this->property_objects_array["{$__type}_entity"] = $object;
358      return $object;
359  }
publicget_entity_id ( type ["default"] )[ order_db ]
Parameters
optionaltype ["default"]
Code
360  public function get_entity_id($__type="default")
361  {
362      $ids = $this->get_entity_ids($__type, true);
363      return (count($ids)==1 ? $ids[0] : null);
364  }
publicget_entity_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ order_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
365  public function get_entity_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
366  {
367      $entity_ids = array();
368      $db = order::db();
369      $q  = " SELECT cor_entity.id FROM com_entity_order INNER JOIN cor_entity ON com_entity_order.entity_id=cor_entity.id AND com_entity_order.deleted=0 AND cor_entity.deleted=0 AND com_entity_order.order_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 " : "");
370      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
371      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
372      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
373      $db->query($q);
374      while ($db->next_record())
375      {
376          $entity_ids[] = $db->f("id");
377      }
378      return $entity_ids;
379  }
publicget_entity_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ order_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
380  public function get_entity_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
381  {
382      $ids = $this->get_entity_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
383      $objects = array();
384      foreach ($ids as $index=>$id)
385      {
386          $objects[$index] = new entity($id);
387      }
388      return $objects;
389  }
public staticget_ids ( order , lookups , where_clause , limit , offset [0] )[ order_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
264  public static function get_ids($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
265  {
266      return order::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset);
267  }
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] )[ order_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
269  public static function get_objects($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
270  {
271      $objects = array();
272      foreach (order::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset) as $id)
273      {
274          $objects[] = new order($id);
275      }
276      return $objects;
277  }
publicget_orderstatus ( )[ order_db ]
Parameters
No parameters for this method
Code
342  public function get_orderstatus()
343  {
344      return new orderstatus($this->orderstatus_id);
345  }
publicget_payment ( type ["default"] )[ order_db ]
Parameters
optionaltype ["default"]
Code
453  public function get_payment($__type="default")
454  {
455      $object = is_null(keyval($this->property_objects_array,"{$__type}_payment")) ? new payment($this->get_payment_id($__type)) : $this->property_objects_array["{$__type}_payment"];
456      $this->property_objects_array["{$__type}_payment"] = $object;
457      return $object;
458  }
publicget_payment_id ( type ["default"] )[ order_db ]
Parameters
optionaltype ["default"]
Code
459  public function get_payment_id($__type="default")
460  {
461      $ids = $this->get_payment_ids($__type, true);
462      return (count($ids)==1 ? $ids[0] : null);
463  }
publicget_payment_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ order_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
464  public function get_payment_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
465  {
466      $payment_ids = array();
467      $db = order::db();
468      $q  = " SELECT com_payment.id FROM com_order_payment INNER JOIN com_payment ON com_order_payment.payment_id=com_payment.id AND com_order_payment.deleted=0 AND com_payment.deleted=0 AND com_order_payment.order_id='$this->id' " . (is_null($__type) ? "" : " AND com_order_payment.order_payment_type_id='" . order_payment::type_id($__type) . "'") . ($__get_primary ? " AND com_order_payment.primary=1 " : "");
469      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
470      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
471      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
472      $db->query($q);
473      while ($db->next_record())
474      {
475          $payment_ids[] = $db->f("id");
476      }
477      return $payment_ids;
478  }
publicget_payment_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ order_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
479  public function get_payment_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
480  {
481      $ids = $this->get_payment_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
482      $objects = array();
483      foreach ($ids as $index=>$id)
484      {
485          $objects[$index] = new payment($id);
486      }
487      return $objects;
488  }
publicget_payments ( )[ order_ext ]
Parameters
No parameters for this method
Code
007  public function get_payments()
008  {
009      return $this->payment_list;
010  }
publicget_products ( )[ order_ext ]
Parameters
No parameters for this method
Code
017  public function get_products()
018  {
019      $products = array();
020      foreach ($this->saleitems as $saleitem)
021      {
022          if ($saleitem->saleitem_type_id = saleitem::type_id("product"))
023          {
024              $products[] = new product($saleitem->id);
025          }
026      }
027      return $products;
028  }
publicget_properties ( )[ obj ]
Parameters
No parameters for this method
Code
121  public function get_properties()
122  {
123      return array_keys($this->array);
124  }
publicget_saleitem ( type ["default"] )[ order_db ]
Parameters
optionaltype ["default"]
Code
552  public function get_saleitem($__type="default")
553  {
554      $object = is_null(keyval($this->property_objects_array,"{$__type}_saleitem")) ? new saleitem($this->get_saleitem_id($__type)) : $this->property_objects_array["{$__type}_saleitem"];
555      $this->property_objects_array["{$__type}_saleitem"] = $object;
556      return $object;
557  }
publicget_saleitem_id ( type ["default"] )[ order_db ]
Parameters
optionaltype ["default"]
Code
558  public function get_saleitem_id($__type="default")
559  {
560      $ids = $this->get_saleitem_ids($__type, true);
561      return (count($ids)==1 ? $ids[0] : null);
562  }
publicget_saleitem_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ order_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
563  public function get_saleitem_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
564  {
565      $saleitem_ids = array();
566      $db = order::db();
567      $q  = " SELECT com_saleitem.id FROM com_order_saleitem INNER JOIN com_saleitem ON com_order_saleitem.saleitem_id=com_saleitem.id AND com_order_saleitem.deleted=0 AND com_saleitem.deleted=0 AND com_order_saleitem.order_id='$this->id' " . (is_null($__type) ? "" : " AND com_order_saleitem.order_saleitem_type_id='" . order_saleitem::type_id($__type) . "'") . ($__get_primary ? " AND com_order_saleitem.primary=1 " : "");
568      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
569      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
570      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
571      $db->query($q);
572      while ($db->next_record())
573      {
574          $saleitem_ids[] = $db->f("id");
575      }
576      return $saleitem_ids;
577  }
publicget_saleitem_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ order_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
578  public function get_saleitem_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
579  {
580      $ids = $this->get_saleitem_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
581      $objects = array();
582      foreach ($ids as $index=>$id)
583      {
584          $objects[$index] = new saleitem($id);
585      }
586      return $objects;
587  }
publicget_saleitems ( )[ order_ext ]
Parameters
No parameters for this method
Code
012  public function get_saleitems()
013  {
014      return $this->saleitem_list;
015  }
publicget_services ( )[ order_ext ]
Parameters
No parameters for this method
Code
030  public function get_services()
031  {
032      $services = array();
033      foreach ($this->saleitems as $saleitem)
034      {
035          if ($saleitem->saleitem_type_id = saleitem::type_id("service"))
036          {
037              $services[] = new product($saleitem->id);
038          }
039      }
040      return $services;
041  }
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  }
protectedinsert ( )[ order_db ]
Parameters
No parameters for this method
Code
129  protected function insert()
130  {
131      $db = order::db();
132      $q  = " INSERT INTO com_order ( ";
133      $q .= $db->param_string("description") . ", ";
134      $q .= $db->param_string("tax") . ", ";
135      $q .= $db->param_string("shipping") . ", ";
136      $q .= $db->param_string("discount") . ", ";
137      $q .= $db->param_string("orderstatus_id") . ", ";
138      $q .= $db->param_string("mdate") . ", ";
139      $q .= $db->param_string("cdate") . ", ";
140      $q .= $db->param_string("deleted");
141      $q .= " ) VALUES ( ";
142      $q .= $db->value_string($this->_description) . ", ";
143      $q .= $db->value_string($this->_tax) . ", ";
144      $q .= $db->value_string($this->_shipping) . ", ";
145      $q .= $db->value_string($this->_discount) . ", ";
146      $q .= $db->value_string($this->_orderstatus_id) . ", ";
147      $q .= $db->value_string(timestamp()) . ", ";
148      $q .= $db->value_string(timestamp()) . ", ";
149      $q .= $this->deleted ? "'1'" : "'0'";
150      $q .= " ) ";
151      $db->query($q);
152      $this->_id = $db->insert_id;
153      return true;
154  }
publicmap ( )[ order_db ]
Parameters
No parameters for this method
Code
098  public function map()
099  {
100      $this->_description = array_key_exists("order:description",$_REQUEST) ? reqval("order:description") : $this->_description;
101      $this->_tax = array_key_exists("order:tax",$_REQUEST) ? reqval("order:tax") : $this->_tax;
102      $this->_shipping = array_key_exists("order:shipping",$_REQUEST) ? reqval("order:shipping") : $this->_shipping;
103      $this->_discount = array_key_exists("order:discount",$_REQUEST) ? reqval("order:discount") : $this->_discount;
104      $this->_orderstatus_id = array_key_exists("order:orderstatus_id",$_REQUEST) ? reqval("order:orderstatus_id") : $this->_orderstatus_id;
105      $this->_mdate = array_key_exists("order:mdate",$_REQUEST) ? reqval("order:mdate") : $this->_mdate;
106      $this->_cdate = array_key_exists("order:cdate",$_REQUEST) ? reqval("order:cdate") : $this->_cdate;
107      $this->_deleted = array_key_exists("order:deleted",$_REQUEST) ? reqval("order:deleted") : $this->_deleted;
108  }
publicpurge ( )[ order_db ]
Parameters
No parameters for this method
Code
194  public function purge()
195  {
196      $db = order::db();
197      $q  = " DELETE FROM com_order ";
198      $q .= " WHERE id = " . $this->_id;
199      $db->query($q);
200      return true;
201  }
public staticsearch ( keyword )[ order_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_entity ( v , type ["default"] )[ order_db ]
Parameters
requiredv
optionaltype ["default"]
Code
391  public function set_entity($__v, $__type="default")
392  {
393      $object = is_null(keyval($this->property_objects_array,"{$__type}_entity")) ? new entity($this->get_entity_id($__type)) : $this->property_objects_array["{$__type}_entity"];
394      if (is_null($__v))
395      {
396          $rel = new entity_order(null,$object->id,$this->id,entity_order::type_id($__type));
397          $rel->delete();
398          if (!is_null(keyval($this->property_objects_array,"{$__type}_entity")))
399          {
400              $this->property_objects_array["{$__type}_entity"] = null;
401          }
402      }
403      else
404      {
405          $id = $object->id;
406          $object = $__v;
407          $object->id = $__v->id>0 ? $__v->id : $id;
408          $object->commit();
409          $this->set_entity_ids(array($object->id),$__type);
410      }
411  }
publicset_entity_id ( v , type ["default"] )[ order_db ]
Parameters
requiredv
optionaltype ["default"]
Code
412  public function set_entity_id($__v, $__type="default")
413  {
414      $this->set_entity_ids(array($__v),$__type);
415  }
publicset_entity_ids ( v , type ["default"] )[ order_db ]
Parameters
requiredv
optionaltype ["default"]
Code
416  public function set_entity_ids($__v, $__type="default")
417  {
418      if ($this->id == 0)
419      {
420          $this->commit();
421      }
422      $type_id = entity_order::type_id($__type);
423      entity_order::delete_all(null,$this->id,$type_id);
424      if (is_array($__v))
425      {
426          foreach ($__v as $index=>$id)
427          {
428              $object = new entity_order(null,$id,$this->id,$type_id);
429              $object->deleted = false;
430              $object->entity_order_type_id = $type_id;
431              $object->commit();
432              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_entity")))
433              {
434                  $this->property_objects_array["{$__type}_entity"] = new entity($object->entity_id);
435              }
436          }
437          $this->_dirty = true;
438      }
439  }
publicset_entity_list ( v , type ["default"] )[ order_db ]
Parameters
requiredv
optionaltype ["default"]
Code
440  public function set_entity_list($__v, $__type="default")
441  {
442      if (is_array($__v))
443      {
444          $ids = array();
445          foreach ($__v as $index=>$object)
446          {
447              $ids[] = $object->id;
448          }
449          $this->set_entity_ids($ids,$__type);
450      }
451  }
publicset_orderstatus ( v )[ order_db ]
Parameters
requiredv
Code
346  public function set_orderstatus($v)
347  {
348      if ($v->id > 0)
349      {
350          $this->orderstatus_id = $v->id;
351      }
352  }
publicset_payment ( v , type ["default"] )[ order_db ]
Parameters
requiredv
optionaltype ["default"]
Code
490  public function set_payment($__v, $__type="default")
491  {
492      $object = is_null(keyval($this->property_objects_array,"{$__type}_payment")) ? new payment($this->get_payment_id($__type)) : $this->property_objects_array["{$__type}_payment"];
493      if (is_null($__v))
494      {
495          $rel = new order_payment(null,$this->id,$object->id,order_payment::type_id($__type));
496          $rel->delete();
497          if (!is_null(keyval($this->property_objects_array,"{$__type}_payment")))
498          {
499              $this->property_objects_array["{$__type}_payment"] = null;
500          }
501      }
502      else
503      {
504          $id = $object->id;
505          $object = $__v;
506          $object->id = $__v->id>0 ? $__v->id : $id;
507          $object->commit();
508          $this->set_payment_ids(array($object->id),$__type);
509      }
510  }
publicset_payment_id ( v , type ["default"] )[ order_db ]
Parameters
requiredv
optionaltype ["default"]
Code
511  public function set_payment_id($__v, $__type="default")
512  {
513      $this->set_payment_ids(array($__v),$__type);
514  }
publicset_payment_ids ( v , type ["default"] )[ order_db ]
Parameters
requiredv
optionaltype ["default"]
Code
515  public function set_payment_ids($__v, $__type="default")
516  {
517      if ($this->id == 0)
518      {
519          $this->commit();
520      }
521      $type_id = order_payment::type_id($__type);
522      order_payment::delete_all($this->id,null,$type_id);
523      if (is_array($__v))
524      {
525          foreach ($__v as $index=>$id)
526          {
527              $object = new order_payment(null,$this->id,$id,$type_id);
528              $object->deleted = false;
529              $object->order_payment_type_id = $type_id;
530              $object->commit();
531              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_payment")))
532              {
533                  $this->property_objects_array["{$__type}_payment"] = new payment($object->payment_id);
534              }
535          }
536          $this->_dirty = true;
537      }
538  }
publicset_payment_list ( v , type ["default"] )[ order_db ]
Parameters
requiredv
optionaltype ["default"]
Code
539  public function set_payment_list($__v, $__type="default")
540  {
541      if (is_array($__v))
542      {
543          $ids = array();
544          foreach ($__v as $index=>$object)
545          {
546              $ids[] = $object->id;
547          }
548          $this->set_payment_ids($ids,$__type);
549      }
550  }
publicset_saleitem ( v , type ["default"] )[ order_db ]
Parameters
requiredv
optionaltype ["default"]
Code
589  public function set_saleitem($__v, $__type="default")
590  {
591      $object = is_null(keyval($this->property_objects_array,"{$__type}_saleitem")) ? new saleitem($this->get_saleitem_id($__type)) : $this->property_objects_array["{$__type}_saleitem"];
592      if (is_null($__v))
593      {
594          $rel = new order_saleitem(null,$this->id,$object->id,order_saleitem::type_id($__type));
595          $rel->delete();
596          if (!is_null(keyval($this->property_objects_array,"{$__type}_saleitem")))
597          {
598              $this->property_objects_array["{$__type}_saleitem"] = null;
599          }
600      }
601      else
602      {
603          $id = $object->id;
604          $object = $__v;
605          $object->id = $__v->id>0 ? $__v->id : $id;
606          $object->commit();
607          $this->set_saleitem_ids(array($object->id),$__type);
608      }
609  }
publicset_saleitem_id ( v , type ["default"] )[ order_db ]
Parameters
requiredv
optionaltype ["default"]
Code
610  public function set_saleitem_id($__v, $__type="default")
611  {
612      $this->set_saleitem_ids(array($__v),$__type);
613  }
publicset_saleitem_ids ( v , type ["default"] )[ order_db ]
Parameters
requiredv
optionaltype ["default"]
Code
614  public function set_saleitem_ids($__v, $__type="default")
615  {
616      if ($this->id == 0)
617      {
618          $this->commit();
619      }
620      $type_id = order_saleitem::type_id($__type);
621      order_saleitem::delete_all($this->id,null,$type_id);
622      if (is_array($__v))
623      {
624          foreach ($__v as $index=>$id)
625          {
626              $object = new order_saleitem(null,$this->id,$id,$type_id);
627              $object->deleted = false;
628              $object->order_saleitem_type_id = $type_id;
629              $object->commit();
630              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_saleitem")))
631              {
632                  $this->property_objects_array["{$__type}_saleitem"] = new saleitem($object->saleitem_id);
633              }
634          }
635          $this->_dirty = true;
636      }
637  }
publicset_saleitem_list ( v , type ["default"] )[ order_db ]
Parameters
requiredv
optionaltype ["default"]
Code
638  public function set_saleitem_list($__v, $__type="default")
639  {
640      if (is_array($__v))
641      {
642          $ids = array();
643          foreach ($__v as $index=>$object)
644          {
645              $ids[] = $object->id;
646          }
647          $this->set_saleitem_ids($ids,$__type);
648      }
649  }
public__toString ( )[ order_db ]
Parameters
No parameters for this method
Code
337  public function __toString()
338  {
339      return (is_null($this->description) ? "" : $this->description);
340  }
publicundelete ( )[ order_db ]
Parameters
No parameters for this method
Code
183  public function undelete()
184  {
185      $db = order::db();
186      $q  = " UPDATE com_order SET ";
187      $q .= " deleted = 0 ";
188      $q .= " WHERE id = " . $this->_id;
189      $db->query($q);
190      $this->deleted = false;
191      return true;
192  }
protectedupdate ( )[ order_db ]
Parameters
No parameters for this method
Code
156  protected function update()
157  {
158      $db = order::db();
159      $q  = " UPDATE com_order SET ";
160      $q .= $db->param_string("description") . " = " . $db->value_string($this->_description) . ", ";
161      $q .= $db->param_string("tax") . " = " . $db->value_string($this->_tax) . ", ";
162      $q .= $db->param_string("shipping") . " = " . $db->value_string($this->_shipping) . ", ";
163      $q .= $db->param_string("discount") . " = " . $db->value_string($this->_discount) . ", ";
164      $q .= $db->param_string("orderstatus_id") . " = " . $db->value_string($this->_orderstatus_id) . ", ";
165      $q .= $db->param_string("mdate") . " = " . $db->value_string(timestamp()) . ", ";
166      $q .= $db->param_string("deleted") . " = " . ($this->deleted ? "'1'" : "'0'");
167      $q .= " WHERE id = " . $this->_id;
168      $db->query($q);
169      return true;
170  }
 
Accessors
publicarray[ obj ]
Code
096  public function get_array()
097  {
098      return get_object_vars($this);
099  }
publicclassname[ obj ]
Code
086  public function get_classname()
087  {
088      return get_class($this);
089  }
publiccolumns[ order_db ]
Code
203  public static function get_columns($__columns, $__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
204  {
205      $lookups = is_array($__lookups) ? $__lookups : array($__lookups);
206      $colarray = is_array($__columns) ? $__columns : explode(",",$__columns);
207      $colstring = is_array($__columns) ? implode(",",$__columns) : $__columns;
208 
209      $db = order::db();
210      $data = array();
211      $q  = " SELECT $colstring ";
212      $q .= " FROM com_order ";
213      $q .= " WHERE com_order.deleted = 0 ";
214      $q .= is_null($__where_clause) ? null : " AND ($__where_clause) ";
215      $q .= array_key_exists("orderstatus_id",$lookups) ? " AND com_order.orderstatus_id='" . $lookups["orderstatus_id"] . "' " : "";
216 
217      if (is_string($__order))
218      {
219          $q .= "ORDER BY " . $__order;
220      }
221      else if (is_array($__order) and count($__order)>0)
222      {
223          $orderings = array();
224          foreach ($__order as $col=>$dir)
225          {
226              $orderings[] = " $col $dir ";
227          }
228          $q .= "ORDER BY " . implode(", ", $orderings);
229      }
230      else if (is_object($__order))
231      {
232          $q .= "";
233      }
234      else
235      {
236          // THERE IS NO `order` COLUMN ON THIS OBJECT
237      }
238 
239      if (!is_null($__limit))
240      {
241          $q .= " LIMIT $__offset , $__limit ";
242      }
243 
244      $db->query($q);
245 
246      if (count($colarray)>1 || $colstring=="*")
247      {
248          while ($db->next_record())
249          {
250              $data[] = $db->record;
251          }
252      }
253      else
254      {
255          while ($db->next_record())
256          {
257              $data[] = $db->f(0);
258          }
259      }
260 
261      return $data;
262  }
publicdirty[ obj ]
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  }
publicentity[ order_db ]
Code
354  public function get_entity($__type="default")
355  {
356      $object = is_null(keyval($this->property_objects_array,"{$__type}_entity")) ? new entity($this->get_entity_id($__type)) : $this->property_objects_array["{$__type}_entity"];
357      $this->property_objects_array["{$__type}_entity"] = $object;
358      return $object;
359  }
Code
391  public function set_entity($__v, $__type="default")
392  {
393      $object = is_null(keyval($this->property_objects_array,"{$__type}_entity")) ? new entity($this->get_entity_id($__type)) : $this->property_objects_array["{$__type}_entity"];
394      if (is_null($__v))
395      {
396          $rel = new entity_order(null,$object->id,$this->id,entity_order::type_id($__type));
397          $rel->delete();
398          if (!is_null(keyval($this->property_objects_array,"{$__type}_entity")))
399          {
400              $this->property_objects_array["{$__type}_entity"] = null;
401          }
402      }
403      else
404      {
405          $id = $object->id;
406          $object = $__v;
407          $object->id = $__v->id>0 ? $__v->id : $id;
408          $object->commit();
409          $this->set_entity_ids(array($object->id),$__type);
410      }
411  }
publicentity_id[ order_db ]
Code
360  public function get_entity_id($__type="default")
361  {
362      $ids = $this->get_entity_ids($__type, true);
363      return (count($ids)==1 ? $ids[0] : null);
364  }
Code
412  public function set_entity_id($__v, $__type="default")
413  {
414      $this->set_entity_ids(array($__v),$__type);
415  }
publicentity_ids[ order_db ]
Code
365  public function get_entity_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
366  {
367      $entity_ids = array();
368      $db = order::db();
369      $q  = " SELECT cor_entity.id FROM com_entity_order INNER JOIN cor_entity ON com_entity_order.entity_id=cor_entity.id AND com_entity_order.deleted=0 AND cor_entity.deleted=0 AND com_entity_order.order_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 " : "");
370      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
371      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
372      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
373      $db->query($q);
374      while ($db->next_record())
375      {
376          $entity_ids[] = $db->f("id");
377      }
378      return $entity_ids;
379  }
Code
416  public function set_entity_ids($__v, $__type="default")
417  {
418      if ($this->id == 0)
419      {
420          $this->commit();
421      }
422      $type_id = entity_order::type_id($__type);
423      entity_order::delete_all(null,$this->id,$type_id);
424      if (is_array($__v))
425      {
426          foreach ($__v as $index=>$id)
427          {
428              $object = new entity_order(null,$id,$this->id,$type_id);
429              $object->deleted = false;
430              $object->entity_order_type_id = $type_id;
431              $object->commit();
432              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_entity")))
433              {
434                  $this->property_objects_array["{$__type}_entity"] = new entity($object->entity_id);
435              }
436          }
437          $this->_dirty = true;
438      }
439  }
publicentity_list[ order_db ]
Code
380  public function get_entity_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
381  {
382      $ids = $this->get_entity_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
383      $objects = array();
384      foreach ($ids as $index=>$id)
385      {
386          $objects[$index] = new entity($id);
387      }
388      return $objects;
389  }
Code
440  public function set_entity_list($__v, $__type="default")
441  {
442      if (is_array($__v))
443      {
444          $ids = array();
445          foreach ($__v as $index=>$object)
446          {
447              $ids[] = $object->id;
448          }
449          $this->set_entity_ids($ids,$__type);
450      }
451  }
publicids[ order_db ]
Code
264  public static function get_ids($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
265  {
266      return order::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset);
267  }
publicjson[ obj ]
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  }
publicobjects[ order_db ]
Code
269  public static function get_objects($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
270  {
271      $objects = array();
272      foreach (order::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset) as $id)
273      {
274          $objects[] = new order($id);
275      }
276      return $objects;
277  }
publicorderstatus[ order_db ]
Code
342  public function get_orderstatus()
343  {
344      return new orderstatus($this->orderstatus_id);
345  }
Code
346  public function set_orderstatus($v)
347  {
348      if ($v->id > 0)
349      {
350          $this->orderstatus_id = $v->id;
351      }
352  }
publicpayment[ order_db ]
Code
453  public function get_payment($__type="default")
454  {
455      $object = is_null(keyval($this->property_objects_array,"{$__type}_payment")) ? new payment($this->get_payment_id($__type)) : $this->property_objects_array["{$__type}_payment"];
456      $this->property_objects_array["{$__type}_payment"] = $object;
457      return $object;
458  }
Code
490  public function set_payment($__v, $__type="default")
491  {
492      $object = is_null(keyval($this->property_objects_array,"{$__type}_payment")) ? new payment($this->get_payment_id($__type)) : $this->property_objects_array["{$__type}_payment"];
493      if (is_null($__v))
494      {
495          $rel = new order_payment(null,$this->id,$object->id,order_payment::type_id($__type));
496          $rel->delete();
497          if (!is_null(keyval($this->property_objects_array,"{$__type}_payment")))
498          {
499              $this->property_objects_array["{$__type}_payment"] = null;
500          }
501      }
502      else
503      {
504          $id = $object->id;
505          $object = $__v;
506          $object->id = $__v->id>0 ? $__v->id : $id;
507          $object->commit();
508          $this->set_payment_ids(array($object->id),$__type);
509      }
510  }
publicpayment_id[ order_db ]
Code
459  public function get_payment_id($__type="default")
460  {
461      $ids = $this->get_payment_ids($__type, true);
462      return (count($ids)==1 ? $ids[0] : null);
463  }
Code
511  public function set_payment_id($__v, $__type="default")
512  {
513      $this->set_payment_ids(array($__v),$__type);
514  }
publicpayment_ids[ order_db ]
Code
464  public function get_payment_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
465  {
466      $payment_ids = array();
467      $db = order::db();
468      $q  = " SELECT com_payment.id FROM com_order_payment INNER JOIN com_payment ON com_order_payment.payment_id=com_payment.id AND com_order_payment.deleted=0 AND com_payment.deleted=0 AND com_order_payment.order_id='$this->id' " . (is_null($__type) ? "" : " AND com_order_payment.order_payment_type_id='" . order_payment::type_id($__type) . "'") . ($__get_primary ? " AND com_order_payment.primary=1 " : "");
469      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
470      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
471      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
472      $db->query($q);
473      while ($db->next_record())
474      {
475          $payment_ids[] = $db->f("id");
476      }
477      return $payment_ids;
478  }
Code
515  public function set_payment_ids($__v, $__type="default")
516  {
517      if ($this->id == 0)
518      {
519          $this->commit();
520      }
521      $type_id = order_payment::type_id($__type);
522      order_payment::delete_all($this->id,null,$type_id);
523      if (is_array($__v))
524      {
525          foreach ($__v as $index=>$id)
526          {
527              $object = new order_payment(null,$this->id,$id,$type_id);
528              $object->deleted = false;
529              $object->order_payment_type_id = $type_id;
530              $object->commit();
531              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_payment")))
532              {
533                  $this->property_objects_array["{$__type}_payment"] = new payment($object->payment_id);
534              }
535          }
536          $this->_dirty = true;
537      }
538  }
publicpayment_list[ order_db ]
Code
479  public function get_payment_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
480  {
481      $ids = $this->get_payment_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
482      $objects = array();
483      foreach ($ids as $index=>$id)
484      {
485          $objects[$index] = new payment($id);
486      }
487      return $objects;
488  }
Code
539  public function set_payment_list($__v, $__type="default")
540  {
541      if (is_array($__v))
542      {
543          $ids = array();
544          foreach ($__v as $index=>$object)
545          {
546              $ids[] = $object->id;
547          }
548          $this->set_payment_ids($ids,$__type);
549      }
550  }
publicpayments[ order_ext ]
Code
007  public function get_payments()
008  {
009      return $this->payment_list;
010  }
publicproducts[ order_ext ]
Code
017  public function get_products()
018  {
019      $products = array();
020      foreach ($this->saleitems as $saleitem)
021      {
022          if ($saleitem->saleitem_type_id = saleitem::type_id("product"))
023          {
024              $products[] = new product($saleitem->id);
025          }
026      }
027      return $products;
028  }
publicproperties[ obj ]
Code
121  public function get_properties()
122  {
123      return array_keys($this->array);
124  }
publicsaleitem[ order_db ]
Code
552  public function get_saleitem($__type="default")
553  {
554      $object = is_null(keyval($this->property_objects_array,"{$__type}_saleitem")) ? new saleitem($this->get_saleitem_id($__type)) : $this->property_objects_array["{$__type}_saleitem"];
555      $this->property_objects_array["{$__type}_saleitem"] = $object;
556      return $object;
557  }
Code
589  public function set_saleitem($__v, $__type="default")
590  {
591      $object = is_null(keyval($this->property_objects_array,"{$__type}_saleitem")) ? new saleitem($this->get_saleitem_id($__type)) : $this->property_objects_array["{$__type}_saleitem"];
592      if (is_null($__v))
593      {
594          $rel = new order_saleitem(null,$this->id,$object->id,order_saleitem::type_id($__type));
595          $rel->delete();
596          if (!is_null(keyval($this->property_objects_array,"{$__type}_saleitem")))
597          {
598              $this->property_objects_array["{$__type}_saleitem"] = null;
599          }
600      }
601      else
602      {
603          $id = $object->id;
604          $object = $__v;
605          $object->id = $__v->id>0 ? $__v->id : $id;
606          $object->commit();
607          $this->set_saleitem_ids(array($object->id),$__type);
608      }
609  }
publicsaleitem_id[ order_db ]
Code
558  public function get_saleitem_id($__type="default")
559  {
560      $ids = $this->get_saleitem_ids($__type, true);
561      return (count($ids)==1 ? $ids[0] : null);
562  }
Code
610  public function set_saleitem_id($__v, $__type="default")
611  {
612      $this->set_saleitem_ids(array($__v),$__type);
613  }
publicsaleitem_ids[ order_db ]
Code
563  public function get_saleitem_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
564  {
565      $saleitem_ids = array();
566      $db = order::db();
567      $q  = " SELECT com_saleitem.id FROM com_order_saleitem INNER JOIN com_saleitem ON com_order_saleitem.saleitem_id=com_saleitem.id AND com_order_saleitem.deleted=0 AND com_saleitem.deleted=0 AND com_order_saleitem.order_id='$this->id' " . (is_null($__type) ? "" : " AND com_order_saleitem.order_saleitem_type_id='" . order_saleitem::type_id($__type) . "'") . ($__get_primary ? " AND com_order_saleitem.primary=1 " : "");
568      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
569      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
570      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
571      $db->query($q);
572      while ($db->next_record())
573      {
574          $saleitem_ids[] = $db->f("id");
575      }
576      return $saleitem_ids;
577  }
Code
614  public function set_saleitem_ids($__v, $__type="default")
615  {
616      if ($this->id == 0)
617      {
618          $this->commit();
619      }
620      $type_id = order_saleitem::type_id($__type);
621      order_saleitem::delete_all($this->id,null,$type_id);
622      if (is_array($__v))
623      {
624          foreach ($__v as $index=>$id)
625          {
626              $object = new order_saleitem(null,$this->id,$id,$type_id);
627              $object->deleted = false;
628              $object->order_saleitem_type_id = $type_id;
629              $object->commit();
630              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_saleitem")))
631              {
632                  $this->property_objects_array["{$__type}_saleitem"] = new saleitem($object->saleitem_id);
633              }
634          }
635          $this->_dirty = true;
636      }
637  }
publicsaleitem_list[ order_db ]
Code
578  public function get_saleitem_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
579  {
580      $ids = $this->get_saleitem_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
581      $objects = array();
582      foreach ($ids as $index=>$id)
583      {
584          $objects[$index] = new saleitem($id);
585      }
586      return $objects;
587  }
Code
638  public function set_saleitem_list($__v, $__type="default")
639  {
640      if (is_array($__v))
641      {
642          $ids = array();
643          foreach ($__v as $index=>$object)
644          {
645              $ids[] = $object->id;
646          }
647          $this->set_saleitem_ids($ids,$__type);
648      }
649  }
publicsaleitems[ order_ext ]
Code
012  public function get_saleitems()
013  {
014      return $this->saleitem_list;
015  }
publicservices[ order_ext ]
Code
030  public function get_services()
031  {
032      $services = array();
033      foreach ($this->saleitems as $saleitem)
034      {
035          if ($saleitem->saleitem_type_id = saleitem::type_id("service"))
036          {
037              $services[] = new product($saleitem->id);
038          }
039      }
040      return $services;
041  }
publicstring[ obj ]
Code
091  protected function get_string()
092  {
093      return method_exists($this,"__toString") ? $this->__toString() : null;
094  }
Get Helix PHP Framework at SourceForge.net. Fast, secure and Free Open Source software downloads