Helix Installation   Getting Started   Reference Documentation   Global Functions   Quick Start
ModulesClassesFunctions
 

Class Reference

class payment extends payment_ext

Hide Inherited MembersE-Commerce
Description
No description.
 
Constants
constantTABLENAME ["com_payment"][ payment ]
 
Properties
protected_amount[ payment_db ]
protected_amount_dirty[ payment_db ]
protected_cdate[ payment_db ]
protected_cdate_dirty[ payment_db ]
protected_deleted[ payment_db ]
protected_deleted_dirty[ payment_db ]
protected_description[ payment_db ]
protected_description_dirty[ payment_db ]
protected_dirty[ obj ]
protected_id[ payment_db ]
protected_id_dirty[ payment_db ]
protected_mdate[ payment_db ]
protected_mdate_dirty[ payment_db ]
protected_payment_type_id[ payment_db ]
protected_payment_type_id_dirty[ payment_db ]
protected_paymentmethod_id[ payment_db ]
protected_paymentmethod_id_dirty[ payment_db ]
protected_paymentstatus_id[ payment_db ]
protected_paymentstatus_id_dirty[ payment_db ]
protected_process_response[ payment_db ]
protected_process_response_dirty[ payment_db ]
publicproperty_objects_array[ obj ]
 
Methods
publiccommit ( )[ payment_db ]
Parameters
No parameters for this method
Code
116  public function commit()
117  {
118      if ($this->_id > 0)
119      {
120          $this->update();
121      }
122      else
123      {
124          $this->insert();
125      }
126 
127      foreach ($this->property_objects_array as $property=>$object)
128      {
129          $this->{$property} = $object;
130      }
131 
132      return true;
133  }
public__construct ( id )[ payment_db ]
Parameters
optionalid
Code
050  public function __construct($__id=null)
051  {
052      $this->_id = 0;
053      $this->_amount = 0;
054      $this->_description = "";
055      $this->_payment_type_id = 0;
056      $this->_paymentmethod_id = 0;
057      $this->_paymentstatus_id = 0;
058      $this->_process_response = "";
059      $this->_mdate = null;
060      $this->_cdate = null;
061      $this->_deleted = false;
062 
063      $this->_id_dirty = false;
064      $this->_amount_dirty = false;
065      $this->_description_dirty = false;
066      $this->_payment_type_id_dirty = false;
067      $this->_paymentmethod_id_dirty = false;
068      $this->_paymentstatus_id_dirty = false;
069      $this->_process_response_dirty = false;
070      $this->_mdate_dirty = false;
071      $this->_cdate_dirty = false;
072      $this->_deleted_dirty = false;
073 
074      if (is_null($__id))
075      {
076          return;
077      }
078 
079      $db = payment::db();
080      $q  = " SELECT com_payment.id,com_payment.amount,com_payment.description,com_payment.payment_type_id,com_payment.paymentmethod_id,com_payment.paymentstatus_id,com_payment.process_response,com_payment.mdate,com_payment.cdate,com_payment.deleted ";
081      $q .= " FROM com_payment ";       
082      if (!is_null($__id))
083      {
084          $q .= " WHERE id = '$__id' ";
085      }
086 
087      $db->query($q);
088      if ($db->next_record() && $db->num_rows() == 1)
089      {
090          $this->_id = $db->f("id");
091          $this->_amount = $db->f("amount");
092          $this->_description = $db->f("description");
093          $this->_payment_type_id = $db->f("payment_type_id");
094          $this->_paymentmethod_id = $db->f("paymentmethod_id");
095          $this->_paymentstatus_id = $db->f("paymentstatus_id");
096          $this->_process_response = $db->f("process_response");
097          $this->_mdate = $db->f("mdate");
098          $this->_cdate = $db->f("cdate");
099          $this->_deleted = $db->f("deleted");
100      }
101  }
protected staticdb ( )[ payment_db ]
Parameters
No parameters for this method
Code
703  protected static function db()
704  {
705      return new db();
706  }
publicdelete ( )[ payment_db ]
Parameters
No parameters for this method
Code
181  public function delete()
182  {
183      $db = payment::db();
184      $q  = " UPDATE com_payment SET ";
185      $q .= " deleted = 1 ";
186      $q .= " WHERE id = " . $this->_id;
187      $db->query($q);
188      $this->deleted = true;
189      return true;
190  }
public staticdelete_all ( )[ payment_db ]
Parameters
No parameters for this method
Code
290  public static function delete_all()
291  {
292      $db = payment::db();
293      $q  = " UPDATE com_payment SET ";
294      $q .= " deleted = 1 ";
295     
296      $db->query($q);
297      return true;
298  }
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] )[ payment_db ]
Parameters
requiredcolumns
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
212  public static function get_columns($__columns, $__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
213  {
214      $lookups = is_array($__lookups) ? $__lookups : array($__lookups);
215      $colarray = is_array($__columns) ? $__columns : explode(",",$__columns);
216      $colstring = is_array($__columns) ? implode(",",$__columns) : $__columns;
217 
218      $db = payment::db();
219      $data = array();
220      $q  = " SELECT $colstring ";
221      $q .= " FROM com_payment ";
222      $q .= " WHERE com_payment.deleted = 0 ";
223      $q .= is_null($__where_clause) ? null : " AND ($__where_clause) ";
224      $q .= array_key_exists("payment_type_id",$lookups) ? " AND com_payment.payment_type_id='" . $lookups["payment_type_id"] . "' " : "";
225      $q .= array_key_exists("paymentmethod_id",$lookups) ? " AND com_payment.paymentmethod_id='" . $lookups["paymentmethod_id"] . "' " : "";
226      $q .= array_key_exists("paymentstatus_id",$lookups) ? " AND com_payment.paymentstatus_id='" . $lookups["paymentstatus_id"] . "' " : "";
227 
228      if (is_string($__order))
229      {
230          $q .= "ORDER BY " . $__order;
231      }
232      else if (is_array($__order) and count($__order)>0)
233      {
234          $orderings = array();
235          foreach ($__order as $col=>$dir)
236          {
237              $orderings[] = " $col $dir ";
238          }
239          $q .= "ORDER BY " . implode(", ", $orderings);
240      }
241      else if (is_object($__order))
242      {
243          $q .= "";
244      }
245      else
246      {
247          // THERE IS NO `order` COLUMN ON THIS OBJECT
248      }
249 
250      if (!is_null($__limit))
251      {
252          $q .= " LIMIT $__offset , $__limit ";
253      }
254 
255      $db->query($q);
256 
257      if (count($colarray)>1 || $colstring=="*")
258      {
259          while ($db->next_record())
260          {
261              $data[] = $db->record;
262          }
263      }
264      else
265      {
266          while ($db->next_record())
267          {
268              $data[] = $db->f(0);
269          }
270      }
271 
272      return $data;
273  }
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"] )[ payment_db ]
Parameters
optionaltype ["default"]
Code
406  public function get_entity($__type="default")
407  {
408      $object = is_null(keyval($this->property_objects_array,"{$__type}_entity")) ? new entity($this->get_entity_id($__type)) : $this->property_objects_array["{$__type}_entity"];
409      $this->property_objects_array["{$__type}_entity"] = $object;
410      return $object;
411  }
publicget_entity_id ( type ["default"] )[ payment_db ]
Parameters
optionaltype ["default"]
Code
412  public function get_entity_id($__type="default")
413  {
414      $ids = $this->get_entity_ids($__type, true);
415      return (count($ids)==1 ? $ids[0] : null);
416  }
publicget_entity_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ payment_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
417  public function get_entity_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
418  {
419      $entity_ids = array();
420      $db = payment::db();
421      $q  = " SELECT cor_entity.id FROM com_entity_payment INNER JOIN cor_entity ON com_entity_payment.entity_id=cor_entity.id AND com_entity_payment.deleted=0 AND cor_entity.deleted=0 AND com_entity_payment.payment_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 " : "");
422      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
423      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
424      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
425      $db->query($q);
426      while ($db->next_record())
427      {
428          $entity_ids[] = $db->f("id");
429      }
430      return $entity_ids;
431  }
publicget_entity_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ payment_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
432  public function get_entity_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
433  {
434      $ids = $this->get_entity_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
435      $objects = array();
436      foreach ($ids as $index=>$id)
437      {
438          $objects[$index] = new entity($id);
439      }
440      return $objects;
441  }
public staticget_ids ( order , lookups , where_clause , limit , offset [0] )[ payment_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
275  public static function get_ids($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
276  {
277      return payment::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset);
278  }
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] )[ payment_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
280  public static function get_objects($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
281  {
282      $objects = array();
283      foreach (payment::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset) as $id)
284      {
285          $objects[] = new payment($id);
286      }
287      return $objects;
288  }
publicget_order ( type ["default"] )[ payment_db ]
Parameters
optionaltype ["default"]
Code
505  public function get_order($__type="default")
506  {
507      $object = is_null(keyval($this->property_objects_array,"{$__type}_order")) ? new order($this->get_order_id($__type)) : $this->property_objects_array["{$__type}_order"];
508      $this->property_objects_array["{$__type}_order"] = $object;
509      return $object;
510  }
publicget_order_id ( type ["default"] )[ payment_db ]
Parameters
optionaltype ["default"]
Code
511  public function get_order_id($__type="default")
512  {
513      $ids = $this->get_order_ids($__type, true);
514      return (count($ids)==1 ? $ids[0] : null);
515  }
publicget_order_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ payment_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
516  public function get_order_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
517  {
518      $order_ids = array();
519      $db = payment::db();
520      $q  = " SELECT com_order.id FROM com_order_payment INNER JOIN com_order ON com_order_payment.order_id=com_order.id AND com_order_payment.deleted=0 AND com_order.deleted=0 AND com_order_payment.payment_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 " : "");
521      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
522      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
523      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
524      $db->query($q);
525      while ($db->next_record())
526      {
527          $order_ids[] = $db->f("id");
528      }
529      return $order_ids;
530  }
publicget_order_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ payment_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
531  public function get_order_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
532  {
533      $ids = $this->get_order_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
534      $objects = array();
535      foreach ($ids as $index=>$id)
536      {
537          $objects[$index] = new order($id);
538      }
539      return $objects;
540  }
publicget_payment_type ( )[ payment_db ]
Parameters
No parameters for this method
Code
370  public function get_payment_type()
371  {
372      return new payment_type($this->payment_type_id);
373  }
publicget_paymentaccount ( type ["default"] )[ payment_db ]
Parameters
optionaltype ["default"]
Code
604  public function get_paymentaccount($__type="default")
605  {
606      $object = is_null(keyval($this->property_objects_array,"{$__type}_paymentaccount")) ? new paymentaccount($this->get_paymentaccount_id($__type)) : $this->property_objects_array["{$__type}_paymentaccount"];
607      $this->property_objects_array["{$__type}_paymentaccount"] = $object;
608      return $object;
609  }
publicget_paymentaccount_id ( type ["default"] )[ payment_db ]
Parameters
optionaltype ["default"]
Code
610  public function get_paymentaccount_id($__type="default")
611  {
612      $ids = $this->get_paymentaccount_ids($__type, true);
613      return (count($ids)==1 ? $ids[0] : null);
614  }
publicget_paymentaccount_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ payment_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
615  public function get_paymentaccount_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
616  {
617      $paymentaccount_ids = array();
618      $db = payment::db();
619      $q  = " SELECT com_paymentaccount.id FROM com_payment_paymentaccount INNER JOIN com_paymentaccount ON com_payment_paymentaccount.paymentaccount_id=com_paymentaccount.id AND com_payment_paymentaccount.deleted=0 AND com_paymentaccount.deleted=0 AND com_payment_paymentaccount.payment_id='$this->id' " . (is_null($__type) ? "" : " AND com_payment_paymentaccount.payment_paymentaccount_type_id='" . payment_paymentaccount::type_id($__type) . "'") . ($__get_primary ? " AND com_payment_paymentaccount.primary=1 " : "");
620      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
621      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
622      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
623      $db->query($q);
624      while ($db->next_record())
625      {
626          $paymentaccount_ids[] = $db->f("id");
627      }
628      return $paymentaccount_ids;
629  }
publicget_paymentaccount_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ payment_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
630  public function get_paymentaccount_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
631  {
632      $ids = $this->get_paymentaccount_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
633      $objects = array();
634      foreach ($ids as $index=>$id)
635      {
636          $objects[$index] = new paymentaccount($id);
637      }
638      return $objects;
639  }
publicget_paymentmethod ( )[ payment_db ]
Parameters
No parameters for this method
Code
382  public function get_paymentmethod()
383  {
384      return new paymentmethod($this->paymentmethod_id);
385  }
publicget_paymentstatus ( )[ payment_db ]
Parameters
No parameters for this method
Code
394  public function get_paymentstatus()
395  {
396      return new paymentstatus($this->paymentstatus_id);
397  }
publicget_properties ( )[ obj ]
Parameters
No parameters for this method
Code
121  public function get_properties()
122  {
123      return array_keys($this->array);
124  }
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_type ( )[ payment_db ]
Parameters
No parameters for this method
Code
359  public function get_type()
360  {
361      $type = new payment_type($this->_payment_type_id);
362      return $type->name;
363  }
protectedinsert ( )[ payment_db ]
Parameters
No parameters for this method
Code
135  protected function insert()
136  {
137      $db = payment::db();
138      $q  = " INSERT INTO com_payment ( ";
139      $q .= $db->param_string("amount") . ", ";
140      $q .= $db->param_string("description") . ", ";
141      $q .= $db->param_string("payment_type_id") . ", ";
142      $q .= $db->param_string("paymentmethod_id") . ", ";
143      $q .= $db->param_string("paymentstatus_id") . ", ";
144      $q .= $db->param_string("process_response") . ", ";
145      $q .= $db->param_string("mdate") . ", ";
146      $q .= $db->param_string("cdate") . ", ";
147      $q .= $db->param_string("deleted");
148      $q .= " ) VALUES ( ";
149      $q .= $db->value_string($this->_amount) . ", ";
150      $q .= $db->value_string($this->_description) . ", ";
151      $q .= $db->value_string($this->_payment_type_id) . ", ";
152      $q .= $db->value_string($this->_paymentmethod_id) . ", ";
153      $q .= $db->value_string($this->_paymentstatus_id) . ", ";
154      $q .= $db->value_string($this->_process_response) . ", ";
155      $q .= $db->value_string(timestamp()) . ", ";
156      $q .= $db->value_string(timestamp()) . ", ";
157      $q .= $this->deleted ? "'1'" : "'0'";
158      $q .= " ) ";
159      $db->query($q);
160      $this->_id = $db->insert_id;
161      return true;
162  }
publicmap ( )[ payment_db ]
Parameters
No parameters for this method
Code
103  public function map()
104  {
105      $this->_amount = array_key_exists("payment:amount",$_REQUEST) ? reqval("payment:amount") : $this->_amount;
106      $this->_description = array_key_exists("payment:description",$_REQUEST) ? reqval("payment:description") : $this->_description;
107      $this->_payment_type_id = array_key_exists("payment:payment_type_id",$_REQUEST) ? reqval("payment:payment_type_id") : $this->_payment_type_id;
108      $this->_paymentmethod_id = array_key_exists("payment:paymentmethod_id",$_REQUEST) ? reqval("payment:paymentmethod_id") : $this->_paymentmethod_id;
109      $this->_paymentstatus_id = array_key_exists("payment:paymentstatus_id",$_REQUEST) ? reqval("payment:paymentstatus_id") : $this->_paymentstatus_id;
110      $this->_process_response = array_key_exists("payment:process_response",$_REQUEST) ? reqval("payment:process_response") : $this->_process_response;
111      $this->_mdate = array_key_exists("payment:mdate",$_REQUEST) ? reqval("payment:mdate") : $this->_mdate;
112      $this->_cdate = array_key_exists("payment:cdate",$_REQUEST) ? reqval("payment:cdate") : $this->_cdate;
113      $this->_deleted = array_key_exists("payment:deleted",$_REQUEST) ? reqval("payment:deleted") : $this->_deleted;
114  }
publicpurge ( )[ payment_db ]
Parameters
No parameters for this method
Code
203  public function purge()
204  {
205      $db = payment::db();
206      $q  = " DELETE FROM com_payment ";
207      $q .= " WHERE id = " . $this->_id;
208      $db->query($q);
209      return true;
210  }
public staticsearch ( keyword )[ payment_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"] )[ payment_db ]
Parameters
requiredv
optionaltype ["default"]
Code
443  public function set_entity($__v, $__type="default")
444  {
445      $object = is_null(keyval($this->property_objects_array,"{$__type}_entity")) ? new entity($this->get_entity_id($__type)) : $this->property_objects_array["{$__type}_entity"];
446      if (is_null($__v))
447      {
448          $rel = new entity_payment(null,$object->id,$this->id,entity_payment::type_id($__type));
449          $rel->delete();
450          if (!is_null(keyval($this->property_objects_array,"{$__type}_entity")))
451          {
452              $this->property_objects_array["{$__type}_entity"] = null;
453          }
454      }
455      else
456      {
457          $id = $object->id;
458          $object = $__v;
459          $object->id = $__v->id>0 ? $__v->id : $id;
460          $object->commit();
461          $this->set_entity_ids(array($object->id),$__type);
462      }
463  }
publicset_entity_id ( v , type ["default"] )[ payment_db ]
Parameters
requiredv
optionaltype ["default"]
Code
464  public function set_entity_id($__v, $__type="default")
465  {
466      $this->set_entity_ids(array($__v),$__type);
467  }
publicset_entity_ids ( v , type ["default"] )[ payment_db ]
Parameters
requiredv
optionaltype ["default"]
Code
468  public function set_entity_ids($__v, $__type="default")
469  {
470      if ($this->id == 0)
471      {
472          $this->commit();
473      }
474      $type_id = entity_payment::type_id($__type);
475      entity_payment::delete_all(null,$this->id,$type_id);
476      if (is_array($__v))
477      {
478          foreach ($__v as $index=>$id)
479          {
480              $object = new entity_payment(null,$id,$this->id,$type_id);
481              $object->deleted = false;
482              $object->entity_payment_type_id = $type_id;
483              $object->commit();
484              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_entity")))
485              {
486                  $this->property_objects_array["{$__type}_entity"] = new entity($object->entity_id);
487              }
488          }
489          $this->_dirty = true;
490      }
491  }
publicset_entity_list ( v , type ["default"] )[ payment_db ]
Parameters
requiredv
optionaltype ["default"]
Code
492  public function set_entity_list($__v, $__type="default")
493  {
494      if (is_array($__v))
495      {
496          $ids = array();
497          foreach ($__v as $index=>$object)
498          {
499              $ids[] = $object->id;
500          }
501          $this->set_entity_ids($ids,$__type);
502      }
503  }
publicset_order ( v , type ["default"] )[ payment_db ]
Parameters
requiredv
optionaltype ["default"]
Code
542  public function set_order($__v, $__type="default")
543  {
544      $object = is_null(keyval($this->property_objects_array,"{$__type}_order")) ? new order($this->get_order_id($__type)) : $this->property_objects_array["{$__type}_order"];
545      if (is_null($__v))
546      {
547          $rel = new order_payment(null,$object->id,$this->id,order_payment::type_id($__type));
548          $rel->delete();
549          if (!is_null(keyval($this->property_objects_array,"{$__type}_order")))
550          {
551              $this->property_objects_array["{$__type}_order"] = null;
552          }
553      }
554      else
555      {
556          $id = $object->id;
557          $object = $__v;
558          $object->id = $__v->id>0 ? $__v->id : $id;
559          $object->commit();
560          $this->set_order_ids(array($object->id),$__type);
561      }
562  }
publicset_order_id ( v , type ["default"] )[ payment_db ]
Parameters
requiredv
optionaltype ["default"]
Code
563  public function set_order_id($__v, $__type="default")
564  {
565      $this->set_order_ids(array($__v),$__type);
566  }
publicset_order_ids ( v , type ["default"] )[ payment_db ]
Parameters
requiredv
optionaltype ["default"]
Code
567  public function set_order_ids($__v, $__type="default")
568  {
569      if ($this->id == 0)
570      {
571          $this->commit();
572      }
573      $type_id = order_payment::type_id($__type);
574      order_payment::delete_all(null,$this->id,$type_id);
575      if (is_array($__v))
576      {
577          foreach ($__v as $index=>$id)
578          {
579              $object = new order_payment(null,$id,$this->id,$type_id);
580              $object->deleted = false;
581              $object->order_payment_type_id = $type_id;
582              $object->commit();
583              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_order")))
584              {
585                  $this->property_objects_array["{$__type}_order"] = new order($object->order_id);
586              }
587          }
588          $this->_dirty = true;
589      }
590  }
publicset_order_list ( v , type ["default"] )[ payment_db ]
Parameters
requiredv
optionaltype ["default"]
Code
591  public function set_order_list($__v, $__type="default")
592  {
593      if (is_array($__v))
594      {
595          $ids = array();
596          foreach ($__v as $index=>$object)
597          {
598              $ids[] = $object->id;
599          }
600          $this->set_order_ids($ids,$__type);
601      }
602  }
publicset_payment_type ( v )[ payment_db ]
Parameters
requiredv
Code
374  public function set_payment_type($v)
375  {
376      if ($v->id > 0)
377      {
378          $this->payment_type_id = $v->id;
379      }
380  }
publicset_paymentaccount ( v , type ["default"] )[ payment_db ]
Parameters
requiredv
optionaltype ["default"]
Code
641  public function set_paymentaccount($__v, $__type="default")
642  {
643      $object = is_null(keyval($this->property_objects_array,"{$__type}_paymentaccount")) ? new paymentaccount($this->get_paymentaccount_id($__type)) : $this->property_objects_array["{$__type}_paymentaccount"];
644      if (is_null($__v))
645      {
646          $rel = new payment_paymentaccount(null,$this->id,$object->id,payment_paymentaccount::type_id($__type));
647          $rel->delete();
648          if (!is_null(keyval($this->property_objects_array,"{$__type}_paymentaccount")))
649          {
650              $this->property_objects_array["{$__type}_paymentaccount"] = null;
651          }
652      }
653      else
654      {
655          $id = $object->id;
656          $object = $__v;
657          $object->id = $__v->id>0 ? $__v->id : $id;
658          $object->commit();
659          $this->set_paymentaccount_ids(array($object->id),$__type);
660      }
661  }
publicset_paymentaccount_id ( v , type ["default"] )[ payment_db ]
Parameters
requiredv
optionaltype ["default"]
Code
662  public function set_paymentaccount_id($__v, $__type="default")
663  {
664      $this->set_paymentaccount_ids(array($__v),$__type);
665  }
publicset_paymentaccount_ids ( v , type ["default"] )[ payment_db ]
Parameters
requiredv
optionaltype ["default"]
Code
666  public function set_paymentaccount_ids($__v, $__type="default")
667  {
668      if ($this->id == 0)
669      {
670          $this->commit();
671      }
672      $type_id = payment_paymentaccount::type_id($__type);
673      payment_paymentaccount::delete_all($this->id,null,$type_id);
674      if (is_array($__v))
675      {
676          foreach ($__v as $index=>$id)
677          {
678              $object = new payment_paymentaccount(null,$this->id,$id,$type_id);
679              $object->deleted = false;
680              $object->payment_paymentaccount_type_id = $type_id;
681              $object->commit();
682              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_paymentaccount")))
683              {
684                  $this->property_objects_array["{$__type}_paymentaccount"] = new paymentaccount($object->paymentaccount_id);
685              }
686          }
687          $this->_dirty = true;
688      }
689  }
publicset_paymentaccount_list ( v , type ["default"] )[ payment_db ]
Parameters
requiredv
optionaltype ["default"]
Code
690  public function set_paymentaccount_list($__v, $__type="default")
691  {
692      if (is_array($__v))
693      {
694          $ids = array();
695          foreach ($__v as $index=>$object)
696          {
697              $ids[] = $object->id;
698          }
699          $this->set_paymentaccount_ids($ids,$__type);
700      }
701  }
publicset_paymentmethod ( v )[ payment_db ]
Parameters
requiredv
Code
386  public function set_paymentmethod($v)
387  {
388      if ($v->id > 0)
389      {
390          $this->paymentmethod_id = $v->id;
391      }
392  }
publicset_paymentstatus ( v )[ payment_db ]
Parameters
requiredv
Code
398  public function set_paymentstatus($v)
399  {
400      if ($v->id > 0)
401      {
402          $this->paymentstatus_id = $v->id;
403      }
404  }
publicset_type ( v )[ payment_db ]
Parameters
requiredv
Code
364  public function set_type($v)
365  {
366      $type = new payment_type(null, $v);
367      $this->payment_type_id = $type->id;
368  }
public__toString ( )[ payment_db ]
Parameters
No parameters for this method
Code
348  public function __toString()
349  {
350      return (is_null($this->description) ? "" : $this->description);
351  }
public statictype_id ( type_name )[ payment_db ]
Parameters
requiredtype_name
Code
353  public static function type_id($__type_name)
354  {
355      $type = new payment_type(null, $__type_name);
356      return $type->id;
357  }
publicundelete ( )[ payment_db ]
Parameters
No parameters for this method
Code
192  public function undelete()
193  {
194      $db = payment::db();
195      $q  = " UPDATE com_payment SET ";
196      $q .= " deleted = 0 ";
197      $q .= " WHERE id = " . $this->_id;
198      $db->query($q);
199      $this->deleted = false;
200      return true;
201  }
protectedupdate ( )[ payment_db ]
Parameters
No parameters for this method
Code
164  protected function update()
165  {
166      $db = payment::db();
167      $q  = " UPDATE com_payment SET ";
168      $q .= $db->param_string("amount") . " = " . $db->value_string($this->_amount) . ", ";
169      $q .= $db->param_string("description") . " = " . $db->value_string($this->_description) . ", ";
170      $q .= $db->param_string("payment_type_id") . " = " . $db->value_string($this->_payment_type_id) . ", ";
171      $q .= $db->param_string("paymentmethod_id") . " = " . $db->value_string($this->_paymentmethod_id) . ", ";
172      $q .= $db->param_string("paymentstatus_id") . " = " . $db->value_string($this->_paymentstatus_id) . ", ";
173      $q .= $db->param_string("process_response") . " = " . $db->value_string($this->_process_response) . ", ";
174      $q .= $db->param_string("mdate") . " = " . $db->value_string(timestamp()) . ", ";
175      $q .= $db->param_string("deleted") . " = " . ($this->deleted ? "'1'" : "'0'");
176      $q .= " WHERE id = " . $this->_id;
177      $db->query($q);
178      return true;
179  }
 
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[ payment_db ]
Code
212  public static function get_columns($__columns, $__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
213  {
214      $lookups = is_array($__lookups) ? $__lookups : array($__lookups);
215      $colarray = is_array($__columns) ? $__columns : explode(",",$__columns);
216      $colstring = is_array($__columns) ? implode(",",$__columns) : $__columns;
217 
218      $db = payment::db();
219      $data = array();
220      $q  = " SELECT $colstring ";
221      $q .= " FROM com_payment ";
222      $q .= " WHERE com_payment.deleted = 0 ";
223      $q .= is_null($__where_clause) ? null : " AND ($__where_clause) ";
224      $q .= array_key_exists("payment_type_id",$lookups) ? " AND com_payment.payment_type_id='" . $lookups["payment_type_id"] . "' " : "";
225      $q .= array_key_exists("paymentmethod_id",$lookups) ? " AND com_payment.paymentmethod_id='" . $lookups["paymentmethod_id"] . "' " : "";
226      $q .= array_key_exists("paymentstatus_id",$lookups) ? " AND com_payment.paymentstatus_id='" . $lookups["paymentstatus_id"] . "' " : "";
227 
228      if (is_string($__order))
229      {
230          $q .= "ORDER BY " . $__order;
231      }
232      else if (is_array($__order) and count($__order)>0)
233      {
234          $orderings = array();
235          foreach ($__order as $col=>$dir)
236          {
237              $orderings[] = " $col $dir ";
238          }
239          $q .= "ORDER BY " . implode(", ", $orderings);
240      }
241      else if (is_object($__order))
242      {
243          $q .= "";
244      }
245      else
246      {
247          // THERE IS NO `order` COLUMN ON THIS OBJECT
248      }
249 
250      if (!is_null($__limit))
251      {
252          $q .= " LIMIT $__offset , $__limit ";
253      }
254 
255      $db->query($q);
256 
257      if (count($colarray)>1 || $colstring=="*")
258      {
259          while ($db->next_record())
260          {
261              $data[] = $db->record;
262          }
263      }
264      else
265      {
266          while ($db->next_record())
267          {
268              $data[] = $db->f(0);
269          }
270      }
271 
272      return $data;
273  }
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[ payment_db ]
Code
406  public function get_entity($__type="default")
407  {
408      $object = is_null(keyval($this->property_objects_array,"{$__type}_entity")) ? new entity($this->get_entity_id($__type)) : $this->property_objects_array["{$__type}_entity"];
409      $this->property_objects_array["{$__type}_entity"] = $object;
410      return $object;
411  }
Code
443  public function set_entity($__v, $__type="default")
444  {
445      $object = is_null(keyval($this->property_objects_array,"{$__type}_entity")) ? new entity($this->get_entity_id($__type)) : $this->property_objects_array["{$__type}_entity"];
446      if (is_null($__v))
447      {
448          $rel = new entity_payment(null,$object->id,$this->id,entity_payment::type_id($__type));
449          $rel->delete();
450          if (!is_null(keyval($this->property_objects_array,"{$__type}_entity")))
451          {
452              $this->property_objects_array["{$__type}_entity"] = null;
453          }
454      }
455      else
456      {
457          $id = $object->id;
458          $object = $__v;
459          $object->id = $__v->id>0 ? $__v->id : $id;
460          $object->commit();
461          $this->set_entity_ids(array($object->id),$__type);
462      }
463  }
publicentity_id[ payment_db ]
Code
412  public function get_entity_id($__type="default")
413  {
414      $ids = $this->get_entity_ids($__type, true);
415      return (count($ids)==1 ? $ids[0] : null);
416  }
Code
464  public function set_entity_id($__v, $__type="default")
465  {
466      $this->set_entity_ids(array($__v),$__type);
467  }
publicentity_ids[ payment_db ]
Code
417  public function get_entity_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
418  {
419      $entity_ids = array();
420      $db = payment::db();
421      $q  = " SELECT cor_entity.id FROM com_entity_payment INNER JOIN cor_entity ON com_entity_payment.entity_id=cor_entity.id AND com_entity_payment.deleted=0 AND cor_entity.deleted=0 AND com_entity_payment.payment_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 " : "");
422      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
423      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
424      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
425      $db->query($q);
426      while ($db->next_record())
427      {
428          $entity_ids[] = $db->f("id");
429      }
430      return $entity_ids;
431  }
Code
468  public function set_entity_ids($__v, $__type="default")
469  {
470      if ($this->id == 0)
471      {
472          $this->commit();
473      }
474      $type_id = entity_payment::type_id($__type);
475      entity_payment::delete_all(null,$this->id,$type_id);
476      if (is_array($__v))
477      {
478          foreach ($__v as $index=>$id)
479          {
480              $object = new entity_payment(null,$id,$this->id,$type_id);
481              $object->deleted = false;
482              $object->entity_payment_type_id = $type_id;
483              $object->commit();
484              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_entity")))
485              {
486                  $this->property_objects_array["{$__type}_entity"] = new entity($object->entity_id);
487              }
488          }
489          $this->_dirty = true;
490      }
491  }
publicentity_list[ payment_db ]
Code
432  public function get_entity_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
433  {
434      $ids = $this->get_entity_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
435      $objects = array();
436      foreach ($ids as $index=>$id)
437      {
438          $objects[$index] = new entity($id);
439      }
440      return $objects;
441  }
Code
492  public function set_entity_list($__v, $__type="default")
493  {
494      if (is_array($__v))
495      {
496          $ids = array();
497          foreach ($__v as $index=>$object)
498          {
499              $ids[] = $object->id;
500          }
501          $this->set_entity_ids($ids,$__type);
502      }
503  }
publicids[ payment_db ]
Code
275  public static function get_ids($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
276  {
277      return payment::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset);
278  }
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[ payment_db ]
Code
280  public static function get_objects($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
281  {
282      $objects = array();
283      foreach (payment::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset) as $id)
284      {
285          $objects[] = new payment($id);
286      }
287      return $objects;
288  }
publicorder[ payment_db ]
Code
505  public function get_order($__type="default")
506  {
507      $object = is_null(keyval($this->property_objects_array,"{$__type}_order")) ? new order($this->get_order_id($__type)) : $this->property_objects_array["{$__type}_order"];
508      $this->property_objects_array["{$__type}_order"] = $object;
509      return $object;
510  }
Code
542  public function set_order($__v, $__type="default")
543  {
544      $object = is_null(keyval($this->property_objects_array,"{$__type}_order")) ? new order($this->get_order_id($__type)) : $this->property_objects_array["{$__type}_order"];
545      if (is_null($__v))
546      {
547          $rel = new order_payment(null,$object->id,$this->id,order_payment::type_id($__type));
548          $rel->delete();
549          if (!is_null(keyval($this->property_objects_array,"{$__type}_order")))
550          {
551              $this->property_objects_array["{$__type}_order"] = null;
552          }
553      }
554      else
555      {
556          $id = $object->id;
557          $object = $__v;
558          $object->id = $__v->id>0 ? $__v->id : $id;
559          $object->commit();
560          $this->set_order_ids(array($object->id),$__type);
561      }
562  }
publicorder_id[ payment_db ]
Code
511  public function get_order_id($__type="default")
512  {
513      $ids = $this->get_order_ids($__type, true);
514      return (count($ids)==1 ? $ids[0] : null);
515  }
Code
563  public function set_order_id($__v, $__type="default")
564  {
565      $this->set_order_ids(array($__v),$__type);
566  }
publicorder_ids[ payment_db ]
Code
516  public function get_order_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
517  {
518      $order_ids = array();
519      $db = payment::db();
520      $q  = " SELECT com_order.id FROM com_order_payment INNER JOIN com_order ON com_order_payment.order_id=com_order.id AND com_order_payment.deleted=0 AND com_order.deleted=0 AND com_order_payment.payment_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 " : "");
521      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
522      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
523      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
524      $db->query($q);
525      while ($db->next_record())
526      {
527          $order_ids[] = $db->f("id");
528      }
529      return $order_ids;
530  }
Code
567  public function set_order_ids($__v, $__type="default")
568  {
569      if ($this->id == 0)
570      {
571          $this->commit();
572      }
573      $type_id = order_payment::type_id($__type);
574      order_payment::delete_all(null,$this->id,$type_id);
575      if (is_array($__v))
576      {
577          foreach ($__v as $index=>$id)
578          {
579              $object = new order_payment(null,$id,$this->id,$type_id);
580              $object->deleted = false;
581              $object->order_payment_type_id = $type_id;
582              $object->commit();
583              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_order")))
584              {
585                  $this->property_objects_array["{$__type}_order"] = new order($object->order_id);
586              }
587          }
588          $this->_dirty = true;
589      }
590  }
publicorder_list[ payment_db ]
Code
531  public function get_order_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
532  {
533      $ids = $this->get_order_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
534      $objects = array();
535      foreach ($ids as $index=>$id)
536      {
537          $objects[$index] = new order($id);
538      }
539      return $objects;
540  }
Code
591  public function set_order_list($__v, $__type="default")
592  {
593      if (is_array($__v))
594      {
595          $ids = array();
596          foreach ($__v as $index=>$object)
597          {
598              $ids[] = $object->id;
599          }
600          $this->set_order_ids($ids,$__type);
601      }
602  }
publicpayment_type[ payment_db ]
Code
370  public function get_payment_type()
371  {
372      return new payment_type($this->payment_type_id);
373  }
Code
374  public function set_payment_type($v)
375  {
376      if ($v->id > 0)
377      {
378          $this->payment_type_id = $v->id;
379      }
380  }
publicpaymentaccount[ payment_db ]
Code
604  public function get_paymentaccount($__type="default")
605  {
606      $object = is_null(keyval($this->property_objects_array,"{$__type}_paymentaccount")) ? new paymentaccount($this->get_paymentaccount_id($__type)) : $this->property_objects_array["{$__type}_paymentaccount"];
607      $this->property_objects_array["{$__type}_paymentaccount"] = $object;
608      return $object;
609  }
Code
641  public function set_paymentaccount($__v, $__type="default")
642  {
643      $object = is_null(keyval($this->property_objects_array,"{$__type}_paymentaccount")) ? new paymentaccount($this->get_paymentaccount_id($__type)) : $this->property_objects_array["{$__type}_paymentaccount"];
644      if (is_null($__v))
645      {
646          $rel = new payment_paymentaccount(null,$this->id,$object->id,payment_paymentaccount::type_id($__type));
647          $rel->delete();
648          if (!is_null(keyval($this->property_objects_array,"{$__type}_paymentaccount")))
649          {
650              $this->property_objects_array["{$__type}_paymentaccount"] = null;
651          }
652      }
653      else
654      {
655          $id = $object->id;
656          $object = $__v;
657          $object->id = $__v->id>0 ? $__v->id : $id;
658          $object->commit();
659          $this->set_paymentaccount_ids(array($object->id),$__type);
660      }
661  }
publicpaymentaccount_id[ payment_db ]
Code
610  public function get_paymentaccount_id($__type="default")
611  {
612      $ids = $this->get_paymentaccount_ids($__type, true);
613      return (count($ids)==1 ? $ids[0] : null);
614  }
Code
662  public function set_paymentaccount_id($__v, $__type="default")
663  {
664      $this->set_paymentaccount_ids(array($__v),$__type);
665  }
publicpaymentaccount_ids[ payment_db ]
Code
615  public function get_paymentaccount_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
616  {
617      $paymentaccount_ids = array();
618      $db = payment::db();
619      $q  = " SELECT com_paymentaccount.id FROM com_payment_paymentaccount INNER JOIN com_paymentaccount ON com_payment_paymentaccount.paymentaccount_id=com_paymentaccount.id AND com_payment_paymentaccount.deleted=0 AND com_paymentaccount.deleted=0 AND com_payment_paymentaccount.payment_id='$this->id' " . (is_null($__type) ? "" : " AND com_payment_paymentaccount.payment_paymentaccount_type_id='" . payment_paymentaccount::type_id($__type) . "'") . ($__get_primary ? " AND com_payment_paymentaccount.primary=1 " : "");
620      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
621      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
622      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
623      $db->query($q);
624      while ($db->next_record())
625      {
626          $paymentaccount_ids[] = $db->f("id");
627      }
628      return $paymentaccount_ids;
629  }
Code
666  public function set_paymentaccount_ids($__v, $__type="default")
667  {
668      if ($this->id == 0)
669      {
670          $this->commit();
671      }
672      $type_id = payment_paymentaccount::type_id($__type);
673      payment_paymentaccount::delete_all($this->id,null,$type_id);
674      if (is_array($__v))
675      {
676          foreach ($__v as $index=>$id)
677          {
678              $object = new payment_paymentaccount(null,$this->id,$id,$type_id);
679              $object->deleted = false;
680              $object->payment_paymentaccount_type_id = $type_id;
681              $object->commit();
682              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_paymentaccount")))
683              {
684                  $this->property_objects_array["{$__type}_paymentaccount"] = new paymentaccount($object->paymentaccount_id);
685              }
686          }
687          $this->_dirty = true;
688      }
689  }
publicpaymentaccount_list[ payment_db ]
Code
630  public function get_paymentaccount_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
631  {
632      $ids = $this->get_paymentaccount_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
633      $objects = array();
634      foreach ($ids as $index=>$id)
635      {
636          $objects[$index] = new paymentaccount($id);
637      }
638      return $objects;
639  }
Code
690  public function set_paymentaccount_list($__v, $__type="default")
691  {
692      if (is_array($__v))
693      {
694          $ids = array();
695          foreach ($__v as $index=>$object)
696          {
697              $ids[] = $object->id;
698          }
699          $this->set_paymentaccount_ids($ids,$__type);
700      }
701  }
publicpaymentmethod[ payment_db ]
Code
382  public function get_paymentmethod()
383  {
384      return new paymentmethod($this->paymentmethod_id);
385  }
Code
386  public function set_paymentmethod($v)
387  {
388      if ($v->id > 0)
389      {
390          $this->paymentmethod_id = $v->id;
391      }
392  }
publicpaymentstatus[ payment_db ]
Code
394  public function get_paymentstatus()
395  {
396      return new paymentstatus($this->paymentstatus_id);
397  }
Code
398  public function set_paymentstatus($v)
399  {
400      if ($v->id > 0)
401      {
402          $this->paymentstatus_id = $v->id;
403      }
404  }
publicproperties[ obj ]
Code
121  public function get_properties()
122  {
123      return array_keys($this->array);
124  }
publicstring[ obj ]
Code
091  protected function get_string()
092  {
093      return method_exists($this,"__toString") ? $this->__toString() : null;
094  }
publictype[ payment_db ]
Code
359  public function get_type()
360  {
361      $type = new payment_type($this->_payment_type_id);
362      return $type->name;
363  }
Code
364  public function set_type($v)
365  {
366      $type = new payment_type(null, $v);
367      $this->payment_type_id = $type->id;
368  }
Get Helix PHP Framework at SourceForge.net. Fast, secure and Free Open Source software downloads