Helix Installation   Getting Started   Reference Documentation   Global Functions   Quick Start
ModulesClassesFunctions
 

Class Reference

class bankaccount extends bankaccount_ext

Hide Inherited MembersE-Commerce
Description
No description.
 
Constants
constantTABLENAME ["com_bankaccount"][ bankaccount ]
 
Properties
protected_account_number[ paymentaccount_db ]
protected_account_number_dirty[ paymentaccount_db ]
protected_bankaccount_type_id[ bankaccount_db ]
protected_bankaccount_type_id_dirty[ bankaccount_db ]
protected_cdate[ bankaccount_db ]
protected_cdate_dirty[ bankaccount_db ]
protected_deleted[ bankaccount_db ]
protected_deleted_dirty[ bankaccount_db ]
protected_description[ paymentaccount_db ]
protected_description_dirty[ paymentaccount_db ]
protected_dirty[ obj ]
protected__id[ bankaccount_db ]
protected_id[ paymentaccount_db ]
protected_id_dirty[ paymentaccount_db ]
protected__id_dirty[ bankaccount_db ]
protected_mdate[ bankaccount_db ]
protected_mdate_dirty[ bankaccount_db ]
protected_name[ paymentaccount_db ]
protected_name_dirty[ paymentaccount_db ]
protected_paymentaccount_id[ bankaccount_db ]
protected_paymentaccount_id_dirty[ bankaccount_db ]
protected_paymentaccount_type_id[ paymentaccount_db ]
protected_paymentaccount_type_id_dirty[ paymentaccount_db ]
publicproperty_objects_array[ obj ]
protected_routing_number[ bankaccount_db ]
protected_routing_number_dirty[ bankaccount_db ]
 
Methods
publiccommit ( )[ bankaccount_db ]
Parameters
No parameters for this method
Code
114  public function commit()
115  {
116      if ($this->_paymentaccount_id > 0)
117      {
118          $this->update();
119      }
120      else
121      {
122          $this->insert();
123      }
124 
125      foreach ($this->property_objects_array as $property=>$object)
126      {
127          $this->{$property} = $object;
128      }
129 
130      return true;
131  }
public__construct ( paymentaccount_id )[ bankaccount_db ]
Parameters
optionalpaymentaccount_id
Code
044  public function __construct($__paymentaccount_id=null)
045  {
046      $this->__id = 0;
047      $this->_paymentaccount_id = 0;
048      $this->_routing_number = "";
049      $this->_bankaccount_type_id = 0;
050      $this->_mdate = null;
051      $this->_cdate = null;
052      $this->_deleted = false;
053      $this->_id = 0;
054      $this->_name = "";
055      $this->_description = "";
056      $this->_paymentaccount_type_id = 0;
057      $this->_account_number = "";
058 
059      $this->__id_dirty = false;
060      $this->_paymentaccount_id_dirty = false;
061      $this->_routing_number_dirty = false;
062      $this->_bankaccount_type_id_dirty = false;
063      $this->_mdate_dirty = false;
064      $this->_cdate_dirty = false;
065      $this->_deleted_dirty = false;
066      $this->_id_dirty = false;
067      $this->_name_dirty = false;
068      $this->_description_dirty = false;
069      $this->_paymentaccount_type_id_dirty = false;
070      $this->_account_number_dirty = false;
071 
072      if (is_null($__paymentaccount_id))
073      {
074          return;
075      }
076 
077      $db = bankaccount::db();
078      $q  = " SELECT com_paymentaccount.id,com_paymentaccount.name,com_paymentaccount.description,com_paymentaccount.paymentaccount_type_id,com_paymentaccount.account_number,com_bankaccount._id,com_bankaccount.paymentaccount_id,com_bankaccount.routing_number,com_bankaccount.bankaccount_type_id,com_bankaccount.mdate,com_bankaccount.cdate,com_bankaccount.deleted ";
079      $q .= " FROM com_bankaccount ";
080      $q .= " INNER JOIN com_paymentaccount ON com_bankaccount.paymentaccount_id=com_paymentaccount.id ";
081      $q .= is_null($__paymentaccount_id) ? "" : " AND com_paymentaccount.id='$__paymentaccount_id' ";       
082 
083      $db->query($q);
084      if ($db->next_record() && $db->num_rows() == 1)
085      {
086          $this->_id = $db->f("id");
087          $this->_name = $db->f("name");
088          $this->_description = $db->f("description");
089          $this->_paymentaccount_type_id = $db->f("paymentaccount_type_id");
090          $this->_account_number = $db->f("account_number");
091          $this->__id = $db->f("_id");
092          $this->_paymentaccount_id = $db->f("paymentaccount_id");
093          $this->_routing_number = $db->f("routing_number");
094          $this->_bankaccount_type_id = $db->f("bankaccount_type_id");
095          $this->_mdate = $db->f("mdate");
096          $this->_cdate = $db->f("cdate");
097          $this->_deleted = $db->f("deleted");
098      }
099  }
protected staticdb ( )[ bankaccount_db ]
Parameters
No parameters for this method
Code
587  protected static function db()
588  {
589      return new db();
590  }
publicdelete ( )[ bankaccount_db ]
Parameters
No parameters for this method
Code
172  public function delete()
173  {
174      parent::delete();
175      $db = bankaccount::db();
176      $q  = " UPDATE com_bankaccount SET ";
177      $q .= " deleted = 1 ";
178      $q .= " WHERE paymentaccount_id = " . $this->_paymentaccount_id;
179      $db->query($q);
180      $this->deleted = true;
181      return true;
182  }
public staticdelete_all ( )[ bankaccount_db ]
Parameters
No parameters for this method
Code
284  public static function delete_all()
285  {
286      $db = bankaccount::db();
287      $q  = " UPDATE com_bankaccount SET ";
288      $q .= " deleted = 1 ";
289     
290      $db->query($q);
291      return true;
292  }
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_ach ( type ["default"] )[ bankaccount_db ]
Parameters
optionaltype ["default"]
Code
389  public function get_ach($__type="default")
390  {
391      $object = is_null(keyval($this->property_objects_array,"{$__type}_ach")) ? new ach($this->get_ach_id($__type)) : $this->property_objects_array["{$__type}_ach"];
392      $this->property_objects_array["{$__type}_ach"] = $object;
393      return $object;
394  }
publicget_ach_id ( type ["default"] )[ bankaccount_db ]
Parameters
optionaltype ["default"]
Code
395  public function get_ach_id($__type="default")
396  {
397      $ids = $this->get_ach_ids($__type, true);
398      return (count($ids)==1 ? $ids[0] : null);
399  }
publicget_ach_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ bankaccount_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
400  public function get_ach_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
401  {
402      $ach_ids = array();
403      $db = bankaccount::db();
404      $q  = " SELECT com_ach.id FROM com_ach_bankaccount INNER JOIN com_ach ON com_ach_bankaccount.ach_id=com_ach.id AND com_ach_bankaccount.deleted=0 AND com_ach.deleted=0 AND com_ach_bankaccount.bankaccount_paymentaccount_id='$this->id' " . (is_null($__type) ? "" : " AND com_ach_bankaccount.ach_bankaccount_type_id='" . ach_bankaccount::type_id($__type) . "'") . ($__get_primary ? " AND com_ach_bankaccount.primary=1 " : "");
405      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
406      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
407      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
408      $db->query($q);
409      while ($db->next_record())
410      {
411          $ach_ids[] = $db->f("id");
412      }
413      return $ach_ids;
414  }
publicget_ach_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ bankaccount_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
415  public function get_ach_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
416  {
417      $ids = $this->get_ach_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
418      $objects = array();
419      foreach ($ids as $index=>$id)
420      {
421          $objects[$index] = new ach($id);
422      }
423      return $objects;
424  }
publicget_array ( )[ obj ]
Parameters
No parameters for this method
Code
096  public function get_array()
097  {
098      return get_object_vars($this);
099  }
publicget_bankaccount_type ( )[ bankaccount_db ]
Parameters
No parameters for this method
Code
377  public function get_bankaccount_type()
378  {
379      return new bankaccount_type($this->bankaccount_type_id);
380  }
publicget_check ( type ["default"] )[ bankaccount_db ]
Parameters
optionaltype ["default"]
Code
488  public function get_check($__type="default")
489  {
490      $object = is_null(keyval($this->property_objects_array,"{$__type}_check")) ? new check($this->get_check_id($__type)) : $this->property_objects_array["{$__type}_check"];
491      $this->property_objects_array["{$__type}_check"] = $object;
492      return $object;
493  }
publicget_check_id ( type ["default"] )[ bankaccount_db ]
Parameters
optionaltype ["default"]
Code
494  public function get_check_id($__type="default")
495  {
496      $ids = $this->get_check_ids($__type, true);
497      return (count($ids)==1 ? $ids[0] : null);
498  }
publicget_check_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ bankaccount_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
499  public function get_check_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
500  {
501      $check_ids = array();
502      $db = bankaccount::db();
503      $q  = " SELECT com_check.id FROM com_bankaccount_check INNER JOIN com_check ON com_bankaccount_check.check_id=com_check.id AND com_bankaccount_check.deleted=0 AND com_check.deleted=0 AND com_bankaccount_check.bankaccount_paymentaccount_id='$this->id' " . (is_null($__type) ? "" : " AND com_bankaccount_check.bankaccount_check_type_id='" . bankaccount_check::type_id($__type) . "'") . ($__get_primary ? " AND com_bankaccount_check.primary=1 " : "");
504      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
505      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
506      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
507      $db->query($q);
508      while ($db->next_record())
509      {
510          $check_ids[] = $db->f("id");
511      }
512      return $check_ids;
513  }
publicget_check_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ bankaccount_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
514  public function get_check_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
515  {
516      $ids = $this->get_check_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
517      $objects = array();
518      foreach ($ids as $index=>$id)
519      {
520          $objects[$index] = new check($id);
521      }
522      return $objects;
523  }
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] )[ bankaccount_db ]
Parameters
requiredcolumns
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
206  public static function get_columns($__columns, $__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
207  {
208      $lookups = is_array($__lookups) ? $__lookups : array($__lookups);
209      $colarray = is_array($__columns) ? $__columns : explode(",",$__columns);
210      $colstring = is_array($__columns) ? implode(",",$__columns) : $__columns;
211 
212      $db = bankaccount::db();
213      $data = array();
214      $q  = " SELECT $colstring ";
215      $q .= " FROM com_bankaccount ";
216      $q .= " INNER JOIN com_paymentaccount ON com_bankaccount.paymentaccount_id=com_paymentaccount.id ";
217      $q .= array_key_exists("paymentaccount_type_id",$lookups) ? " AND com_paymentaccount.paymentaccount_type_id='" . $lookups["paymentaccount_type_id"] . "' " : "";
218      $q .= " WHERE com_bankaccount.deleted = 0 ";
219      $q .= is_null($__where_clause) ? null : " AND ($__where_clause) ";
220      $q .= array_key_exists("bankaccount_type_id",$lookups) ? " AND com_bankaccount.bankaccount_type_id='" . $lookups["bankaccount_type_id"] . "' " : "";
221 
222      if (is_string($__order))
223      {
224          $q .= "ORDER BY " . $__order;
225      }
226      else if (is_array($__order) and count($__order)>0)
227      {
228          $orderings = array();
229          foreach ($__order as $col=>$dir)
230          {
231              $orderings[] = " $col $dir ";
232          }
233          $q .= "ORDER BY " . implode(", ", $orderings);
234      }
235      else if (is_object($__order))
236      {
237          $q .= "";
238      }
239      else
240      {
241          // THERE IS NO `order` COLUMN ON THIS OBJECT
242      }
243 
244      if (!is_null($__limit))
245      {
246          $q .= " LIMIT $__offset , $__limit ";
247      }
248 
249      $db->query($q);
250 
251      if (count($colarray)>1 || $colstring=="*")
252      {
253          while ($db->next_record())
254          {
255              $data[] = $db->record;
256          }
257      }
258      else
259      {
260          while ($db->next_record())
261          {
262              $data[] = $db->f(0);
263          }
264      }
265 
266      return $data;
267  }
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"] )[ paymentaccount_db ]
Parameters
optionaltype ["default"]
Code
362  public function get_entity($__type="default")
363  {
364      $object = is_null(keyval($this->property_objects_array,"{$__type}_entity")) ? new entity($this->get_entity_id($__type)) : $this->property_objects_array["{$__type}_entity"];
365      $this->property_objects_array["{$__type}_entity"] = $object;
366      return $object;
367  }
publicget_entity_id ( type ["default"] )[ paymentaccount_db ]
Parameters
optionaltype ["default"]
Code
368  public function get_entity_id($__type="default")
369  {
370      $ids = $this->get_entity_ids($__type, true);
371      return (count($ids)==1 ? $ids[0] : null);
372  }
publicget_entity_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ paymentaccount_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
373  public function get_entity_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
374  {
375      $entity_ids = array();
376      $db = paymentaccount::db();
377      $q  = " SELECT cor_entity.id FROM com_entity_paymentaccount INNER JOIN cor_entity ON com_entity_paymentaccount.entity_id=cor_entity.id AND com_entity_paymentaccount.deleted=0 AND cor_entity.deleted=0 AND com_entity_paymentaccount.paymentaccount_id='$this->id' " . (is_null($__type) ? "" : " AND com_entity_paymentaccount.entity_paymentaccount_type_id='" . entity_paymentaccount::type_id($__type) . "'") . ($__get_primary ? " AND com_entity_paymentaccount.primary=1 " : "");
378      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
379      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
380      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
381      $db->query($q);
382      while ($db->next_record())
383      {
384          $entity_ids[] = $db->f("id");
385      }
386      return $entity_ids;
387  }
publicget_entity_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ paymentaccount_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
388  public function get_entity_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
389  {
390      $ids = $this->get_entity_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
391      $objects = array();
392      foreach ($ids as $index=>$id)
393      {
394          $objects[$index] = new entity($id);
395      }
396      return $objects;
397  }
public staticget_ids ( order , lookups , where_clause , limit , offset [0] )[ bankaccount_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
269  public static function get_ids($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
270  {
271      return bankaccount::get_columns("paymentaccount_id", $__order, $__lookups, $__where_clause, $__limit, $__offset);
272  }
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] )[ bankaccount_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
274  public static function get_objects($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
275  {
276      $objects = array();
277      foreach (bankaccount::get_columns("paymentaccount_id", $__order, $__lookups, $__where_clause, $__limit, $__offset) as $id)
278      {
279          $objects[] = new bankaccount($id);
280      }
281      return $objects;
282  }
publicget_payment ( type ["default"] )[ paymentaccount_db ]
Parameters
optionaltype ["default"]
Code
461  public function get_payment($__type="default")
462  {
463      $object = is_null(keyval($this->property_objects_array,"{$__type}_payment")) ? new payment($this->get_payment_id($__type)) : $this->property_objects_array["{$__type}_payment"];
464      $this->property_objects_array["{$__type}_payment"] = $object;
465      return $object;
466  }
publicget_payment_id ( type ["default"] )[ paymentaccount_db ]
Parameters
optionaltype ["default"]
Code
467  public function get_payment_id($__type="default")
468  {
469      $ids = $this->get_payment_ids($__type, true);
470      return (count($ids)==1 ? $ids[0] : null);
471  }
publicget_payment_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ paymentaccount_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
472  public function get_payment_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
473  {
474      $payment_ids = array();
475      $db = paymentaccount::db();
476      $q  = " SELECT com_payment.id FROM com_payment_paymentaccount INNER JOIN com_payment ON com_payment_paymentaccount.payment_id=com_payment.id AND com_payment_paymentaccount.deleted=0 AND com_payment.deleted=0 AND com_payment_paymentaccount.paymentaccount_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 " : "");
477      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
478      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
479      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
480      $db->query($q);
481      while ($db->next_record())
482      {
483          $payment_ids[] = $db->f("id");
484      }
485      return $payment_ids;
486  }
publicget_payment_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ paymentaccount_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
487  public function get_payment_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
488  {
489      $ids = $this->get_payment_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
490      $objects = array();
491      foreach ($ids as $index=>$id)
492      {
493          $objects[$index] = new payment($id);
494      }
495      return $objects;
496  }
publicget_paymentaccount ( )[ bankaccount_db ]
Parameters
No parameters for this method
Code
365  public function get_paymentaccount()
366  {
367      return new paymentaccount($this->paymentaccount_id);
368  }
publicget_paymentaccount_type ( )[ paymentaccount_db ]
Parameters
No parameters for this method
Code
350  public function get_paymentaccount_type()
351  {
352      return new paymentaccount_type($this->paymentaccount_type_id);
353  }
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 ( )[ bankaccount_db ]
Parameters
No parameters for this method
Code
354  public function get_type()
355  {
356      $type = new bankaccount_type($this->_bankaccount_type_id);
357      return $type->name;
358  }
protectedinsert ( )[ bankaccount_db ]
Parameters
No parameters for this method
Code
133  protected function insert()
134  {
135      parent::insert();
136      $this->_paymentaccount_id = $this->id;
137      $db = bankaccount::db();
138      $q  = " INSERT INTO com_bankaccount ( ";
139      $q .= $db->param_string("paymentaccount_id") . ", ";
140      $q .= $db->param_string("routing_number") . ", ";
141      $q .= $db->param_string("bankaccount_type_id") . ", ";
142      $q .= $db->param_string("mdate") . ", ";
143      $q .= $db->param_string("cdate") . ", ";
144      $q .= $db->param_string("deleted");
145      $q .= " ) VALUES ( ";
146      $q .= $db->value_string($this->_paymentaccount_id) . ", ";
147      $q .= $db->value_string($this->_routing_number) . ", ";
148      $q .= $db->value_string($this->_bankaccount_type_id) . ", ";
149      $q .= $db->value_string(timestamp()) . ", ";
150      $q .= $db->value_string(timestamp()) . ", ";
151      $q .= $this->deleted ? "'1'" : "'0'";
152      $q .= " ) ";
153      $db->query($q);
154      return true;
155  }
publicmap ( )[ bankaccount_db ]
Parameters
No parameters for this method
Code
101  public function map()
102  {
103      $this->_name = array_key_exists("bankaccount:name",$_REQUEST) ? reqval("bankaccount:name") : $this->_name;
104      $this->_description = array_key_exists("bankaccount:description",$_REQUEST) ? reqval("bankaccount:description") : $this->_description;
105      $this->_paymentaccount_type_id = array_key_exists("bankaccount:paymentaccount_type_id",$_REQUEST) ? reqval("bankaccount:paymentaccount_type_id") : $this->_paymentaccount_type_id;
106      $this->_account_number = array_key_exists("bankaccount:account_number",$_REQUEST) ? reqval("bankaccount:account_number") : $this->_account_number;
107      $this->_routing_number = array_key_exists("bankaccount:routing_number",$_REQUEST) ? reqval("bankaccount:routing_number") : $this->_routing_number;
108      $this->_bankaccount_type_id = array_key_exists("bankaccount:bankaccount_type_id",$_REQUEST) ? reqval("bankaccount:bankaccount_type_id") : $this->_bankaccount_type_id;
109      $this->_mdate = array_key_exists("bankaccount:mdate",$_REQUEST) ? reqval("bankaccount:mdate") : $this->_mdate;
110      $this->_cdate = array_key_exists("bankaccount:cdate",$_REQUEST) ? reqval("bankaccount:cdate") : $this->_cdate;
111      $this->_deleted = array_key_exists("bankaccount:deleted",$_REQUEST) ? reqval("bankaccount:deleted") : $this->_deleted;
112  }
publicpurge ( )[ bankaccount_db ]
Parameters
No parameters for this method
Code
196  public function purge()
197  {
198      parent::purge();
199      $db = bankaccount::db();
200      $q  = " DELETE FROM com_bankaccount ";
201      $q .= " WHERE paymentaccount_id = " . $this->_paymentaccount_id;
202      $db->query($q);
203      return true;
204  }
public staticsearch ( keyword )[ bankaccount_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_ach ( v , type ["default"] )[ bankaccount_db ]
Parameters
requiredv
optionaltype ["default"]
Code
426  public function set_ach($__v, $__type="default")
427  {
428      $object = is_null(keyval($this->property_objects_array,"{$__type}_ach")) ? new ach($this->get_ach_id($__type)) : $this->property_objects_array["{$__type}_ach"];
429      if (is_null($__v))
430      {
431          $rel = new ach_bankaccount(null,$object->id,$this->id,ach_bankaccount::type_id($__type));
432          $rel->delete();
433          if (!is_null(keyval($this->property_objects_array,"{$__type}_ach")))
434          {
435              $this->property_objects_array["{$__type}_ach"] = null;
436          }
437      }
438      else
439      {
440          $id = $object->id;
441          $object = $__v;
442          $object->id = $__v->id>0 ? $__v->id : $id;
443          $object->commit();
444          $this->set_ach_ids(array($object->id),$__type);
445      }
446  }
publicset_ach_id ( v , type ["default"] )[ bankaccount_db ]
Parameters
requiredv
optionaltype ["default"]
Code
447  public function set_ach_id($__v, $__type="default")
448  {
449      $this->set_ach_ids(array($__v),$__type);
450  }
publicset_ach_ids ( v , type ["default"] )[ bankaccount_db ]
Parameters
requiredv
optionaltype ["default"]
Code
451  public function set_ach_ids($__v, $__type="default")
452  {
453      if ($this->id == 0)
454      {
455          $this->commit();
456      }
457      $type_id = ach_bankaccount::type_id($__type);
458      ach_bankaccount::delete_all(null,$this->id,$type_id);
459      if (is_array($__v))
460      {
461          foreach ($__v as $index=>$id)
462          {
463              $object = new ach_bankaccount(null,$id,$this->id,$type_id);
464              $object->deleted = false;
465              $object->ach_bankaccount_type_id = $type_id;
466              $object->commit();
467              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_ach")))
468              {
469                  $this->property_objects_array["{$__type}_ach"] = new ach($object->ach_id);
470              }
471          }
472          $this->_dirty = true;
473      }
474  }
publicset_ach_list ( v , type ["default"] )[ bankaccount_db ]
Parameters
requiredv
optionaltype ["default"]
Code
475  public function set_ach_list($__v, $__type="default")
476  {
477      if (is_array($__v))
478      {
479          $ids = array();
480          foreach ($__v as $index=>$object)
481          {
482              $ids[] = $object->id;
483          }
484          $this->set_ach_ids($ids,$__type);
485      }
486  }
publicset_bankaccount_type ( v )[ bankaccount_db ]
Parameters
requiredv
Code
381  public function set_bankaccount_type($v)
382  {
383      if ($v->id > 0)
384      {
385          $this->bankaccount_type_id = $v->id;
386      }
387  }
publicset_check ( v , type ["default"] )[ bankaccount_db ]
Parameters
requiredv
optionaltype ["default"]
Code
525  public function set_check($__v, $__type="default")
526  {
527      $object = is_null(keyval($this->property_objects_array,"{$__type}_check")) ? new check($this->get_check_id($__type)) : $this->property_objects_array["{$__type}_check"];
528      if (is_null($__v))
529      {
530          $rel = new bankaccount_check(null,$this->id,$object->id,bankaccount_check::type_id($__type));
531          $rel->delete();
532          if (!is_null(keyval($this->property_objects_array,"{$__type}_check")))
533          {
534              $this->property_objects_array["{$__type}_check"] = null;
535          }
536      }
537      else
538      {
539          $id = $object->id;
540          $object = $__v;
541          $object->id = $__v->id>0 ? $__v->id : $id;
542          $object->commit();
543          $this->set_check_ids(array($object->id),$__type);
544      }
545  }
publicset_check_id ( v , type ["default"] )[ bankaccount_db ]
Parameters
requiredv
optionaltype ["default"]
Code
546  public function set_check_id($__v, $__type="default")
547  {
548      $this->set_check_ids(array($__v),$__type);
549  }
publicset_check_ids ( v , type ["default"] )[ bankaccount_db ]
Parameters
requiredv
optionaltype ["default"]
Code
550  public function set_check_ids($__v, $__type="default")
551  {
552      if ($this->id == 0)
553      {
554          $this->commit();
555      }
556      $type_id = bankaccount_check::type_id($__type);
557      bankaccount_check::delete_all($this->id,null,$type_id);
558      if (is_array($__v))
559      {
560          foreach ($__v as $index=>$id)
561          {
562              $object = new bankaccount_check(null,$this->id,$id,$type_id);
563              $object->deleted = false;
564              $object->bankaccount_check_type_id = $type_id;
565              $object->commit();
566              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_check")))
567              {
568                  $this->property_objects_array["{$__type}_check"] = new check($object->check_id);
569              }
570          }
571          $this->_dirty = true;
572      }
573  }
publicset_check_list ( v , type ["default"] )[ bankaccount_db ]
Parameters
requiredv
optionaltype ["default"]
Code
574  public function set_check_list($__v, $__type="default")
575  {
576      if (is_array($__v))
577      {
578          $ids = array();
579          foreach ($__v as $index=>$object)
580          {
581              $ids[] = $object->id;
582          }
583          $this->set_check_ids($ids,$__type);
584      }
585  }
publicset_entity ( v , type ["default"] )[ paymentaccount_db ]
Parameters
requiredv
optionaltype ["default"]
Code
399  public function set_entity($__v, $__type="default")
400  {
401      $object = is_null(keyval($this->property_objects_array,"{$__type}_entity")) ? new entity($this->get_entity_id($__type)) : $this->property_objects_array["{$__type}_entity"];
402      if (is_null($__v))
403      {
404          $rel = new entity_paymentaccount(null,$object->id,$this->id,entity_paymentaccount::type_id($__type));
405          $rel->delete();
406          if (!is_null(keyval($this->property_objects_array,"{$__type}_entity")))
407          {
408              $this->property_objects_array["{$__type}_entity"] = null;
409          }
410      }
411      else
412      {
413          $id = $object->id;
414          $object = $__v;
415          $object->id = $__v->id>0 ? $__v->id : $id;
416          $object->commit();
417          $this->set_entity_ids(array($object->id),$__type);
418      }
419  }
publicset_entity_id ( v , type ["default"] )[ paymentaccount_db ]
Parameters
requiredv
optionaltype ["default"]
Code
420  public function set_entity_id($__v, $__type="default")
421  {
422      $this->set_entity_ids(array($__v),$__type);
423  }
publicset_entity_ids ( v , type ["default"] )[ paymentaccount_db ]
Parameters
requiredv
optionaltype ["default"]
Code
424  public function set_entity_ids($__v, $__type="default")
425  {
426      if ($this->id == 0)
427      {
428          $this->commit();
429      }
430      $type_id = entity_paymentaccount::type_id($__type);
431      entity_paymentaccount::delete_all(null,$this->id,$type_id);
432      if (is_array($__v))
433      {
434          foreach ($__v as $index=>$id)
435          {
436              $object = new entity_paymentaccount(null,$id,$this->id,$type_id);
437              $object->deleted = false;
438              $object->entity_paymentaccount_type_id = $type_id;
439              $object->commit();
440              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_entity")))
441              {
442                  $this->property_objects_array["{$__type}_entity"] = new entity($object->entity_id);
443              }
444          }
445          $this->_dirty = true;
446      }
447  }
publicset_entity_list ( v , type ["default"] )[ paymentaccount_db ]
Parameters
requiredv
optionaltype ["default"]
Code
448  public function set_entity_list($__v, $__type="default")
449  {
450      if (is_array($__v))
451      {
452          $ids = array();
453          foreach ($__v as $index=>$object)
454          {
455              $ids[] = $object->id;
456          }
457          $this->set_entity_ids($ids,$__type);
458      }
459  }
publicset_payment ( v , type ["default"] )[ paymentaccount_db ]
Parameters
requiredv
optionaltype ["default"]
Code
498  public function set_payment($__v, $__type="default")
499  {
500      $object = is_null(keyval($this->property_objects_array,"{$__type}_payment")) ? new payment($this->get_payment_id($__type)) : $this->property_objects_array["{$__type}_payment"];
501      if (is_null($__v))
502      {
503          $rel = new payment_paymentaccount(null,$object->id,$this->id,payment_paymentaccount::type_id($__type));
504          $rel->delete();
505          if (!is_null(keyval($this->property_objects_array,"{$__type}_payment")))
506          {
507              $this->property_objects_array["{$__type}_payment"] = null;
508          }
509      }
510      else
511      {
512          $id = $object->id;
513          $object = $__v;
514          $object->id = $__v->id>0 ? $__v->id : $id;
515          $object->commit();
516          $this->set_payment_ids(array($object->id),$__type);
517      }
518  }
publicset_payment_id ( v , type ["default"] )[ paymentaccount_db ]
Parameters
requiredv
optionaltype ["default"]
Code
519  public function set_payment_id($__v, $__type="default")
520  {
521      $this->set_payment_ids(array($__v),$__type);
522  }
publicset_payment_ids ( v , type ["default"] )[ paymentaccount_db ]
Parameters
requiredv
optionaltype ["default"]
Code
523  public function set_payment_ids($__v, $__type="default")
524  {
525      if ($this->id == 0)
526      {
527          $this->commit();
528      }
529      $type_id = payment_paymentaccount::type_id($__type);
530      payment_paymentaccount::delete_all(null,$this->id,$type_id);
531      if (is_array($__v))
532      {
533          foreach ($__v as $index=>$id)
534          {
535              $object = new payment_paymentaccount(null,$id,$this->id,$type_id);
536              $object->deleted = false;
537              $object->payment_paymentaccount_type_id = $type_id;
538              $object->commit();
539              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_payment")))
540              {
541                  $this->property_objects_array["{$__type}_payment"] = new payment($object->payment_id);
542              }
543          }
544          $this->_dirty = true;
545      }
546  }
publicset_payment_list ( v , type ["default"] )[ paymentaccount_db ]
Parameters
requiredv
optionaltype ["default"]
Code
547  public function set_payment_list($__v, $__type="default")
548  {
549      if (is_array($__v))
550      {
551          $ids = array();
552          foreach ($__v as $index=>$object)
553          {
554              $ids[] = $object->id;
555          }
556          $this->set_payment_ids($ids,$__type);
557      }
558  }
publicset_paymentaccount ( v )[ bankaccount_db ]
Parameters
requiredv
Code
369  public function set_paymentaccount($v)
370  {
371      if ($v->id > 0)
372      {
373          $this->paymentaccount_id = $v->id;
374      }
375  }
publicset_paymentaccount_type ( v )[ paymentaccount_db ]
Parameters
requiredv
Code
354  public function set_paymentaccount_type($v)
355  {
356      if ($v->id > 0)
357      {
358          $this->paymentaccount_type_id = $v->id;
359      }
360  }
publicset_type ( v )[ bankaccount_db ]
Parameters
requiredv
Code
359  public function set_type($v)
360  {
361      $type = new bankaccount_type(null, $v);
362      $this->bankaccount_type_id = $type->id;
363  }
public__toString ( )[ bankaccount_db ]
Parameters
No parameters for this method
Code
343  public function __toString()
344  {
345      return (is_null($this->id) ? "" : $this->id);
346  }
public statictype_id ( type_name )[ bankaccount_db ]
Parameters
requiredtype_name
Code
348  public static function type_id($__type_name)
349  {
350      $type = new bankaccount_type(null, $__type_name);
351      return $type->id;
352  }
publicundelete ( )[ bankaccount_db ]
Parameters
No parameters for this method
Code
184  public function undelete()
185  {
186      parent::undelete();
187      $db = bankaccount::db();
188      $q  = " UPDATE com_bankaccount SET ";
189      $q .= " deleted = 0 ";
190      $q .= " WHERE paymentaccount_id = " . $this->_paymentaccount_id;
191      $db->query($q);
192      $this->deleted = false;
193      return true;
194  }
protectedupdate ( )[ bankaccount_db ]
Parameters
No parameters for this method
Code
157  protected function update()
158  {
159      parent::update();
160      $db = bankaccount::db();
161      $q  = " UPDATE com_bankaccount SET ";
162      $q .= $db->param_string("paymentaccount_id") . " = " . $db->value_string($this->_paymentaccount_id) . ", ";
163      $q .= $db->param_string("routing_number") . " = " . $db->value_string($this->_routing_number) . ", ";
164      $q .= $db->param_string("bankaccount_type_id") . " = " . $db->value_string($this->_bankaccount_type_id) . ", ";
165      $q .= $db->param_string("mdate") . " = " . $db->value_string(timestamp()) . ", ";
166      $q .= $db->param_string("deleted") . " = " . ($this->deleted ? "'1'" : "'0'");
167      $q .= " WHERE paymentaccount_id = " . $this->_paymentaccount_id;
168      $db->query($q);
169      return true;
170  }
 
Accessors
publicach[ bankaccount_db ]
Code
389  public function get_ach($__type="default")
390  {
391      $object = is_null(keyval($this->property_objects_array,"{$__type}_ach")) ? new ach($this->get_ach_id($__type)) : $this->property_objects_array["{$__type}_ach"];
392      $this->property_objects_array["{$__type}_ach"] = $object;
393      return $object;
394  }
Code
426  public function set_ach($__v, $__type="default")
427  {
428      $object = is_null(keyval($this->property_objects_array,"{$__type}_ach")) ? new ach($this->get_ach_id($__type)) : $this->property_objects_array["{$__type}_ach"];
429      if (is_null($__v))
430      {
431          $rel = new ach_bankaccount(null,$object->id,$this->id,ach_bankaccount::type_id($__type));
432          $rel->delete();
433          if (!is_null(keyval($this->property_objects_array,"{$__type}_ach")))
434          {
435              $this->property_objects_array["{$__type}_ach"] = null;
436          }
437      }
438      else
439      {
440          $id = $object->id;
441          $object = $__v;
442          $object->id = $__v->id>0 ? $__v->id : $id;
443          $object->commit();
444          $this->set_ach_ids(array($object->id),$__type);
445      }
446  }
publicach_id[ bankaccount_db ]
Code
395  public function get_ach_id($__type="default")
396  {
397      $ids = $this->get_ach_ids($__type, true);
398      return (count($ids)==1 ? $ids[0] : null);
399  }
Code
447  public function set_ach_id($__v, $__type="default")
448  {
449      $this->set_ach_ids(array($__v),$__type);
450  }
publicach_ids[ bankaccount_db ]
Code
400  public function get_ach_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
401  {
402      $ach_ids = array();
403      $db = bankaccount::db();
404      $q  = " SELECT com_ach.id FROM com_ach_bankaccount INNER JOIN com_ach ON com_ach_bankaccount.ach_id=com_ach.id AND com_ach_bankaccount.deleted=0 AND com_ach.deleted=0 AND com_ach_bankaccount.bankaccount_paymentaccount_id='$this->id' " . (is_null($__type) ? "" : " AND com_ach_bankaccount.ach_bankaccount_type_id='" . ach_bankaccount::type_id($__type) . "'") . ($__get_primary ? " AND com_ach_bankaccount.primary=1 " : "");
405      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
406      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
407      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
408      $db->query($q);
409      while ($db->next_record())
410      {
411          $ach_ids[] = $db->f("id");
412      }
413      return $ach_ids;
414  }
Code
451  public function set_ach_ids($__v, $__type="default")
452  {
453      if ($this->id == 0)
454      {
455          $this->commit();
456      }
457      $type_id = ach_bankaccount::type_id($__type);
458      ach_bankaccount::delete_all(null,$this->id,$type_id);
459      if (is_array($__v))
460      {
461          foreach ($__v as $index=>$id)
462          {
463              $object = new ach_bankaccount(null,$id,$this->id,$type_id);
464              $object->deleted = false;
465              $object->ach_bankaccount_type_id = $type_id;
466              $object->commit();
467              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_ach")))
468              {
469                  $this->property_objects_array["{$__type}_ach"] = new ach($object->ach_id);
470              }
471          }
472          $this->_dirty = true;
473      }
474  }
publicach_list[ bankaccount_db ]
Code
415  public function get_ach_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
416  {
417      $ids = $this->get_ach_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
418      $objects = array();
419      foreach ($ids as $index=>$id)
420      {
421          $objects[$index] = new ach($id);
422      }
423      return $objects;
424  }
Code
475  public function set_ach_list($__v, $__type="default")
476  {
477      if (is_array($__v))
478      {
479          $ids = array();
480          foreach ($__v as $index=>$object)
481          {
482              $ids[] = $object->id;
483          }
484          $this->set_ach_ids($ids,$__type);
485      }
486  }
publicarray[ obj ]
Code
096  public function get_array()
097  {
098      return get_object_vars($this);
099  }
publicbankaccount_type[ bankaccount_db ]
Code
377  public function get_bankaccount_type()
378  {
379      return new bankaccount_type($this->bankaccount_type_id);
380  }
Code
381  public function set_bankaccount_type($v)
382  {
383      if ($v->id > 0)
384      {
385          $this->bankaccount_type_id = $v->id;
386      }
387  }
publiccheck[ bankaccount_db ]
Code
488  public function get_check($__type="default")
489  {
490      $object = is_null(keyval($this->property_objects_array,"{$__type}_check")) ? new check($this->get_check_id($__type)) : $this->property_objects_array["{$__type}_check"];
491      $this->property_objects_array["{$__type}_check"] = $object;
492      return $object;
493  }
Code
525  public function set_check($__v, $__type="default")
526  {
527      $object = is_null(keyval($this->property_objects_array,"{$__type}_check")) ? new check($this->get_check_id($__type)) : $this->property_objects_array["{$__type}_check"];
528      if (is_null($__v))
529      {
530          $rel = new bankaccount_check(null,$this->id,$object->id,bankaccount_check::type_id($__type));
531          $rel->delete();
532          if (!is_null(keyval($this->property_objects_array,"{$__type}_check")))
533          {
534              $this->property_objects_array["{$__type}_check"] = null;
535          }
536      }
537      else
538      {
539          $id = $object->id;
540          $object = $__v;
541          $object->id = $__v->id>0 ? $__v->id : $id;
542          $object->commit();
543          $this->set_check_ids(array($object->id),$__type);
544      }
545  }
publiccheck_id[ bankaccount_db ]
Code
494  public function get_check_id($__type="default")
495  {
496      $ids = $this->get_check_ids($__type, true);
497      return (count($ids)==1 ? $ids[0] : null);
498  }
Code
546  public function set_check_id($__v, $__type="default")
547  {
548      $this->set_check_ids(array($__v),$__type);
549  }
publiccheck_ids[ bankaccount_db ]
Code
499  public function get_check_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
500  {
501      $check_ids = array();
502      $db = bankaccount::db();
503      $q  = " SELECT com_check.id FROM com_bankaccount_check INNER JOIN com_check ON com_bankaccount_check.check_id=com_check.id AND com_bankaccount_check.deleted=0 AND com_check.deleted=0 AND com_bankaccount_check.bankaccount_paymentaccount_id='$this->id' " . (is_null($__type) ? "" : " AND com_bankaccount_check.bankaccount_check_type_id='" . bankaccount_check::type_id($__type) . "'") . ($__get_primary ? " AND com_bankaccount_check.primary=1 " : "");
504      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
505      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
506      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
507      $db->query($q);
508      while ($db->next_record())
509      {
510          $check_ids[] = $db->f("id");
511      }
512      return $check_ids;
513  }
Code
550  public function set_check_ids($__v, $__type="default")
551  {
552      if ($this->id == 0)
553      {
554          $this->commit();
555      }
556      $type_id = bankaccount_check::type_id($__type);
557      bankaccount_check::delete_all($this->id,null,$type_id);
558      if (is_array($__v))
559      {
560          foreach ($__v as $index=>$id)
561          {
562              $object = new bankaccount_check(null,$this->id,$id,$type_id);
563              $object->deleted = false;
564              $object->bankaccount_check_type_id = $type_id;
565              $object->commit();
566              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_check")))
567              {
568                  $this->property_objects_array["{$__type}_check"] = new check($object->check_id);
569              }
570          }
571          $this->_dirty = true;
572      }
573  }
publiccheck_list[ bankaccount_db ]
Code
514  public function get_check_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
515  {
516      $ids = $this->get_check_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
517      $objects = array();
518      foreach ($ids as $index=>$id)
519      {
520          $objects[$index] = new check($id);
521      }
522      return $objects;
523  }
Code
574  public function set_check_list($__v, $__type="default")
575  {
576      if (is_array($__v))
577      {
578          $ids = array();
579          foreach ($__v as $index=>$object)
580          {
581              $ids[] = $object->id;
582          }
583          $this->set_check_ids($ids,$__type);
584      }
585  }
publicclassname[ obj ]
Code
086  public function get_classname()
087  {
088      return get_class($this);
089  }
publiccolumns[ bankaccount_db ]
Code
206  public static function get_columns($__columns, $__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
207  {
208      $lookups = is_array($__lookups) ? $__lookups : array($__lookups);
209      $colarray = is_array($__columns) ? $__columns : explode(",",$__columns);
210      $colstring = is_array($__columns) ? implode(",",$__columns) : $__columns;
211 
212      $db = bankaccount::db();
213      $data = array();
214      $q  = " SELECT $colstring ";
215      $q .= " FROM com_bankaccount ";
216      $q .= " INNER JOIN com_paymentaccount ON com_bankaccount.paymentaccount_id=com_paymentaccount.id ";
217      $q .= array_key_exists("paymentaccount_type_id",$lookups) ? " AND com_paymentaccount.paymentaccount_type_id='" . $lookups["paymentaccount_type_id"] . "' " : "";
218      $q .= " WHERE com_bankaccount.deleted = 0 ";
219      $q .= is_null($__where_clause) ? null : " AND ($__where_clause) ";
220      $q .= array_key_exists("bankaccount_type_id",$lookups) ? " AND com_bankaccount.bankaccount_type_id='" . $lookups["bankaccount_type_id"] . "' " : "";
221 
222      if (is_string($__order))
223      {
224          $q .= "ORDER BY " . $__order;
225      }
226      else if (is_array($__order) and count($__order)>0)
227      {
228          $orderings = array();
229          foreach ($__order as $col=>$dir)
230          {
231              $orderings[] = " $col $dir ";
232          }
233          $q .= "ORDER BY " . implode(", ", $orderings);
234      }
235      else if (is_object($__order))
236      {
237          $q .= "";
238      }
239      else
240      {
241          // THERE IS NO `order` COLUMN ON THIS OBJECT
242      }
243 
244      if (!is_null($__limit))
245      {
246          $q .= " LIMIT $__offset , $__limit ";
247      }
248 
249      $db->query($q);
250 
251      if (count($colarray)>1 || $colstring=="*")
252      {
253          while ($db->next_record())
254          {
255              $data[] = $db->record;
256          }
257      }
258      else
259      {
260          while ($db->next_record())
261          {
262              $data[] = $db->f(0);
263          }
264      }
265 
266      return $data;
267  }
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[ paymentaccount_db ]
Code
362  public function get_entity($__type="default")
363  {
364      $object = is_null(keyval($this->property_objects_array,"{$__type}_entity")) ? new entity($this->get_entity_id($__type)) : $this->property_objects_array["{$__type}_entity"];
365      $this->property_objects_array["{$__type}_entity"] = $object;
366      return $object;
367  }
Code
399  public function set_entity($__v, $__type="default")
400  {
401      $object = is_null(keyval($this->property_objects_array,"{$__type}_entity")) ? new entity($this->get_entity_id($__type)) : $this->property_objects_array["{$__type}_entity"];
402      if (is_null($__v))
403      {
404          $rel = new entity_paymentaccount(null,$object->id,$this->id,entity_paymentaccount::type_id($__type));
405          $rel->delete();
406          if (!is_null(keyval($this->property_objects_array,"{$__type}_entity")))
407          {
408              $this->property_objects_array["{$__type}_entity"] = null;
409          }
410      }
411      else
412      {
413          $id = $object->id;
414          $object = $__v;
415          $object->id = $__v->id>0 ? $__v->id : $id;
416          $object->commit();
417          $this->set_entity_ids(array($object->id),$__type);
418      }
419  }
publicentity_id[ paymentaccount_db ]
Code
368  public function get_entity_id($__type="default")
369  {
370      $ids = $this->get_entity_ids($__type, true);
371      return (count($ids)==1 ? $ids[0] : null);
372  }
Code
420  public function set_entity_id($__v, $__type="default")
421  {
422      $this->set_entity_ids(array($__v),$__type);
423  }
publicentity_ids[ paymentaccount_db ]
Code
373  public function get_entity_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
374  {
375      $entity_ids = array();
376      $db = paymentaccount::db();
377      $q  = " SELECT cor_entity.id FROM com_entity_paymentaccount INNER JOIN cor_entity ON com_entity_paymentaccount.entity_id=cor_entity.id AND com_entity_paymentaccount.deleted=0 AND cor_entity.deleted=0 AND com_entity_paymentaccount.paymentaccount_id='$this->id' " . (is_null($__type) ? "" : " AND com_entity_paymentaccount.entity_paymentaccount_type_id='" . entity_paymentaccount::type_id($__type) . "'") . ($__get_primary ? " AND com_entity_paymentaccount.primary=1 " : "");
378      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
379      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
380      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
381      $db->query($q);
382      while ($db->next_record())
383      {
384          $entity_ids[] = $db->f("id");
385      }
386      return $entity_ids;
387  }
Code
424  public function set_entity_ids($__v, $__type="default")
425  {
426      if ($this->id == 0)
427      {
428          $this->commit();
429      }
430      $type_id = entity_paymentaccount::type_id($__type);
431      entity_paymentaccount::delete_all(null,$this->id,$type_id);
432      if (is_array($__v))
433      {
434          foreach ($__v as $index=>$id)
435          {
436              $object = new entity_paymentaccount(null,$id,$this->id,$type_id);
437              $object->deleted = false;
438              $object->entity_paymentaccount_type_id = $type_id;
439              $object->commit();
440              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_entity")))
441              {
442                  $this->property_objects_array["{$__type}_entity"] = new entity($object->entity_id);
443              }
444          }
445          $this->_dirty = true;
446      }
447  }
publicentity_list[ paymentaccount_db ]
Code
388  public function get_entity_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
389  {
390      $ids = $this->get_entity_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
391      $objects = array();
392      foreach ($ids as $index=>$id)
393      {
394          $objects[$index] = new entity($id);
395      }
396      return $objects;
397  }
Code
448  public function set_entity_list($__v, $__type="default")
449  {
450      if (is_array($__v))
451      {
452          $ids = array();
453          foreach ($__v as $index=>$object)
454          {
455              $ids[] = $object->id;
456          }
457          $this->set_entity_ids($ids,$__type);
458      }
459  }
publicids[ bankaccount_db ]
Code
269  public static function get_ids($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
270  {
271      return bankaccount::get_columns("paymentaccount_id", $__order, $__lookups, $__where_clause, $__limit, $__offset);
272  }
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[ bankaccount_db ]
Code
274  public static function get_objects($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
275  {
276      $objects = array();
277      foreach (bankaccount::get_columns("paymentaccount_id", $__order, $__lookups, $__where_clause, $__limit, $__offset) as $id)
278      {
279          $objects[] = new bankaccount($id);
280      }
281      return $objects;
282  }
publicpayment[ paymentaccount_db ]
Code
461  public function get_payment($__type="default")
462  {
463      $object = is_null(keyval($this->property_objects_array,"{$__type}_payment")) ? new payment($this->get_payment_id($__type)) : $this->property_objects_array["{$__type}_payment"];
464      $this->property_objects_array["{$__type}_payment"] = $object;
465      return $object;
466  }
Code
498  public function set_payment($__v, $__type="default")
499  {
500      $object = is_null(keyval($this->property_objects_array,"{$__type}_payment")) ? new payment($this->get_payment_id($__type)) : $this->property_objects_array["{$__type}_payment"];
501      if (is_null($__v))
502      {
503          $rel = new payment_paymentaccount(null,$object->id,$this->id,payment_paymentaccount::type_id($__type));
504          $rel->delete();
505          if (!is_null(keyval($this->property_objects_array,"{$__type}_payment")))
506          {
507              $this->property_objects_array["{$__type}_payment"] = null;
508          }
509      }
510      else
511      {
512          $id = $object->id;
513          $object = $__v;
514          $object->id = $__v->id>0 ? $__v->id : $id;
515          $object->commit();
516          $this->set_payment_ids(array($object->id),$__type);
517      }
518  }
publicpayment_id[ paymentaccount_db ]
Code
467  public function get_payment_id($__type="default")
468  {
469      $ids = $this->get_payment_ids($__type, true);
470      return (count($ids)==1 ? $ids[0] : null);
471  }
Code
519  public function set_payment_id($__v, $__type="default")
520  {
521      $this->set_payment_ids(array($__v),$__type);
522  }
publicpayment_ids[ paymentaccount_db ]
Code
472  public function get_payment_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
473  {
474      $payment_ids = array();
475      $db = paymentaccount::db();
476      $q  = " SELECT com_payment.id FROM com_payment_paymentaccount INNER JOIN com_payment ON com_payment_paymentaccount.payment_id=com_payment.id AND com_payment_paymentaccount.deleted=0 AND com_payment.deleted=0 AND com_payment_paymentaccount.paymentaccount_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 " : "");
477      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
478      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
479      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
480      $db->query($q);
481      while ($db->next_record())
482      {
483          $payment_ids[] = $db->f("id");
484      }
485      return $payment_ids;
486  }
Code
523  public function set_payment_ids($__v, $__type="default")
524  {
525      if ($this->id == 0)
526      {
527          $this->commit();
528      }
529      $type_id = payment_paymentaccount::type_id($__type);
530      payment_paymentaccount::delete_all(null,$this->id,$type_id);
531      if (is_array($__v))
532      {
533          foreach ($__v as $index=>$id)
534          {
535              $object = new payment_paymentaccount(null,$id,$this->id,$type_id);
536              $object->deleted = false;
537              $object->payment_paymentaccount_type_id = $type_id;
538              $object->commit();
539              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_payment")))
540              {
541                  $this->property_objects_array["{$__type}_payment"] = new payment($object->payment_id);
542              }
543          }
544          $this->_dirty = true;
545      }
546  }
publicpayment_list[ paymentaccount_db ]
Code
487  public function get_payment_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
488  {
489      $ids = $this->get_payment_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
490      $objects = array();
491      foreach ($ids as $index=>$id)
492      {
493          $objects[$index] = new payment($id);
494      }
495      return $objects;
</