Helix Installation   Getting Started   Reference Documentation   Global Functions   Quick Start
ModulesClassesFunctions
 

Class Reference

class check extends check_ext

Hide Inherited MembersE-Commerce
Description
No description.
 
Constants
constantTABLENAME ["com_check"][ check ]
 
Properties
protected_cdate[ check_db ]
protected_cdate_dirty[ check_db ]
protected_check_number[ check_db ]
protected_check_number_dirty[ check_db ]
protected_check_type_id[ check_db ]
protected_check_type_id_dirty[ check_db ]
protected_date[ check_db ]
protected_date_dirty[ check_db ]
protected_deleted[ check_db ]
protected_deleted_dirty[ check_db ]
protected_dirty[ obj ]
protected_id[ check_db ]
protected_id_dirty[ check_db ]
protected_mdate[ check_db ]
protected_mdate_dirty[ check_db ]
protected_memo[ check_db ]
protected_memo_dirty[ check_db ]
protected_payee[ check_db ]
protected_payee_dirty[ check_db ]
publicproperty_objects_array[ obj ]
 
Methods
publiccommit ( )[ check_db ]
Parameters
No parameters for this method
Code
110  public function commit()
111  {
112      if ($this->_id > 0)
113      {
114          $this->update();
115      }
116      else
117      {
118          $this->insert();
119      }
120 
121      foreach ($this->property_objects_array as $property=>$object)
122      {
123          $this->{$property} = $object;
124      }
125 
126      return true;
127  }
public__construct ( id )[ check_db ]
Parameters
optionalid
Code
048  public function __construct($__id=null)
049  {
050      $this->_id = 0;
051      $this->_payee = "";
052      $this->_check_number = 0;
053      $this->_memo = "";
054      $this->_check_type_id = 0;
055      $this->_date = null;
056      $this->_mdate = null;
057      $this->_cdate = null;
058      $this->_deleted = false;
059 
060      $this->_id_dirty = false;
061      $this->_payee_dirty = false;
062      $this->_check_number_dirty = false;
063      $this->_memo_dirty = false;
064      $this->_check_type_id_dirty = false;
065      $this->_date_dirty = false;
066      $this->_mdate_dirty = false;
067      $this->_cdate_dirty = false;
068      $this->_deleted_dirty = false;
069 
070      if (is_null($__id))
071      {
072          return;
073      }
074 
075      $db = check::db();
076      $q  = " SELECT com_check.id,com_check.payee,com_check.check_number,com_check.memo,com_check.check_type_id,com_check.date,com_check.mdate,com_check.cdate,com_check.deleted ";
077      $q .= " FROM com_check ";       
078      if (!is_null($__id))
079      {
080          $q .= " WHERE id = '$__id' ";
081      }
082 
083      $db->query($q);
084      if ($db->next_record() && $db->num_rows() == 1)
085      {
086          $this->_id = $db->f("id");
087          $this->_payee = $db->f("payee");
088          $this->_check_number = $db->f("check_number");
089          $this->_memo = $db->f("memo");
090          $this->_check_type_id = $db->f("check_type_id");
091          $this->_date = $db->f("date");
092          $this->_mdate = $db->f("mdate");
093          $this->_cdate = $db->f("cdate");
094          $this->_deleted = $db->f("deleted");
095      }
096  }
protected staticdb ( )[ check_db ]
Parameters
No parameters for this method
Code
470  protected static function db()
471  {
472      return new db();
473  }
publicdelete ( )[ check_db ]
Parameters
No parameters for this method
Code
172  public function delete()
173  {
174      $db = check::db();
175      $q  = " UPDATE com_check SET ";
176      $q .= " deleted = 1 ";
177      $q .= " WHERE id = " . $this->_id;
178      $db->query($q);
179      $this->deleted = true;
180      return true;
181  }
public staticdelete_all ( )[ check_db ]
Parameters
No parameters for this method
Code
279  public static function delete_all()
280  {
281      $db = check::db();
282      $q  = " UPDATE com_check SET ";
283      $q .= " deleted = 1 ";
284     
285      $db->query($q);
286      return true;
287  }
public__get ( p )[ obj ]
Parameters
requiredp
Code
007  public function __get($p)
008  {
009      $methods = get_class_methods($this);
010      $properties = get_object_vars($this);
011      if (in_array("get_$p",$methods))
012      {
013          return $this->{"get_$p"}();
014      }
015      else if (array_key_exists("_$p",$properties))
016      {
017          return $this->{"_$p"};
018      }
019      else if (in_array("get_" . substr($p,strpos($p,"_")+1), $methods))
020      {
021          return $this->{"get_" . substr($p,strpos($p,"_")+1)}(substr($p,0,strpos($p,"_")));
022      }
023      else
024      {
025          trigger_error("This object [" . get_class($this) . ":$this->id] has no private property '_$p' for the requested public property '$p'",E_USER_WARNING);
026          return null;
027      }
028  }
publicget_array ( )[ obj ]
Parameters
No parameters for this method
Code
096  public function get_array()
097  {
098      return get_object_vars($this);
099  }
publicget_bankaccount ( type ["default"] )[ check_db ]
Parameters
optionaltype ["default"]
Code
371  public function get_bankaccount($__type="default")
372  {
373      $object = is_null(keyval($this->property_objects_array,"{$__type}_bankaccount")) ? new bankaccount($this->get_bankaccount_id($__type)) : $this->property_objects_array["{$__type}_bankaccount"];
374      $this->property_objects_array["{$__type}_bankaccount"] = $object;
375      return $object;
376  }
publicget_bankaccount_id ( type ["default"] )[ check_db ]
Parameters
optionaltype ["default"]
Code
377  public function get_bankaccount_id($__type="default")
378  {
379      $ids = $this->get_bankaccount_ids($__type, true);
380      return (count($ids)==1 ? $ids[0] : null);
381  }
publicget_bankaccount_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ check_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
382  public function get_bankaccount_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
383  {
384      $bankaccount_ids = array();
385      $db = check::db();
386      $q  = " SELECT com_bankaccount.paymentaccount_id FROM com_bankaccount_check INNER JOIN com_bankaccount ON com_bankaccount_check.bankaccount_paymentaccount_id=com_bankaccount.paymentaccount_id AND com_bankaccount_check.deleted=0 AND com_bankaccount.deleted=0 AND com_bankaccount_check.check_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 " : "");
387      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
388      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
389      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
390      $db->query($q);
391      while ($db->next_record())
392      {
393          $bankaccount_ids[] = $db->f("paymentaccount_id");
394      }
395      return $bankaccount_ids;
396  }
publicget_bankaccount_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ check_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
397  public function get_bankaccount_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
398  {
399      $ids = $this->get_bankaccount_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
400      $objects = array();
401      foreach ($ids as $index=>$id)
402      {
403          $objects[$index] = new bankaccount($id);
404      }
405      return $objects;
406  }
publicget_check_type ( )[ check_db ]
Parameters
No parameters for this method
Code
359  public function get_check_type()
360  {
361      return new check_type($this->check_type_id);
362  }
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] )[ check_db ]
Parameters
requiredcolumns
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
203  public static function get_columns($__columns, $__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
204  {
205      $lookups = is_array($__lookups) ? $__lookups : array($__lookups);
206      $colarray = is_array($__columns) ? $__columns : explode(",",$__columns);
207      $colstring = is_array($__columns) ? implode(",",$__columns) : $__columns;
208 
209      $db = check::db();
210      $data = array();
211      $q  = " SELECT $colstring ";
212      $q .= " FROM com_check ";
213      $q .= " WHERE com_check.deleted = 0 ";
214      $q .= is_null($__where_clause) ? null : " AND ($__where_clause) ";
215      $q .= array_key_exists("check_type_id",$lookups) ? " AND com_check.check_type_id='" . $lookups["check_type_id"] . "' " : "";
216 
217      if (is_string($__order))
218      {
219          $q .= "ORDER BY " . $__order;
220      }
221      else if (is_array($__order) and count($__order)>0)
222      {
223          $orderings = array();
224          foreach ($__order as $col=>$dir)
225          {
226              $orderings[] = " $col $dir ";
227          }
228          $q .= "ORDER BY " . implode(", ", $orderings);
229      }
230      else if (is_object($__order))
231      {
232          $q .= "";
233      }
234      else
235      {
236          // THERE IS NO `order` COLUMN ON THIS OBJECT
237      }
238 
239      if (!is_null($__limit))
240      {
241          $q .= " LIMIT $__offset , $__limit ";
242      }
243 
244      $db->query($q);
245 
246      if (count($colarray)>1 || $colstring=="*")
247      {
248          while ($db->next_record())
249          {
250              $data[] = $db->record;
251          }
252      }
253      else
254      {
255          while ($db->next_record())
256          {
257              $data[] = $db->f(0);
258          }
259      }
260 
261      return $data;
262  }
publicget_dirty ( )[ obj ]
Parameters
No parameters for this method
Code
063  public function get_dirty()
064  {
065      if ($this->id === 0)
066      {
067          $this->_dirty = true;
068      }
069      else
070      {
071          foreach (get_object_vars($this) as $k=>$v)
072          {
073              if ($this->_dirty)
074              {
075                  break;
076              }
077              if (preg_match('/_dirty$/',$k))
078              {
079                  $this->_dirty = $this->_dirty || $v;
080              }
081          }
082      }
083      return $this->_dirty;
084  }
public staticget_ids ( order , lookups , where_clause , limit , offset [0] )[ check_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
264  public static function get_ids($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
265  {
266      return check::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset);
267  }
publicget_json ( )[ obj ]
Parameters
No parameters for this method
Code
101  public function get_json()
102  {
103      $class = new ReflectionClass($this->classname);
104      $methods = $class->getMethods();
105      usort($methods,"sort_reflection_objects");
106      $accessors = array();
107      foreach ($methods as $index=>$method)
108      {
109          $declarer = $method->getDeclaringClass()->name;
110          if (preg_match('/^(get|set|)_(.+)$/',$method->name,$matches))
111          {
112              $accessor = $matches[2];
113              $getset = $matches[1];
114              eval("\$accessors[\$accessor] = \$this->".$accessor.";");
115          }
116      }
117      //return json_encode($this->get_array());
118      return json_encode($accessors);
119  }
public staticget_objects ( order , lookups , where_clause , limit , offset [0] )[ check_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
269  public static function get_objects($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
270  {
271      $objects = array();
272      foreach (check::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset) as $id)
273      {
274          $objects[] = new check($id);
275      }
276      return $objects;
277  }
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 ( )[ check_db ]
Parameters
No parameters for this method
Code
348  public function get_type()
349  {
350      $type = new check_type($this->_check_type_id);
351      return $type->name;
352  }
protectedinsert ( )[ check_db ]
Parameters
No parameters for this method
Code
129  protected function insert()
130  {
131      $db = check::db();
132      $q  = " INSERT INTO com_check ( ";
133      $q .= $db->param_string("payee") . ", ";
134      $q .= $db->param_string("check_number") . ", ";
135      $q .= $db->param_string("memo") . ", ";
136      $q .= $db->param_string("check_type_id") . ", ";
137      $q .= $db->param_string("date") . ", ";
138      $q .= $db->param_string("mdate") . ", ";
139      $q .= $db->param_string("cdate") . ", ";
140      $q .= $db->param_string("deleted");
141      $q .= " ) VALUES ( ";
142      $q .= $db->value_string($this->_payee) . ", ";
143      $q .= $db->value_string($this->_check_number) . ", ";
144      $q .= $db->value_string($this->_memo) . ", ";
145      $q .= $db->value_string($this->_check_type_id) . ", ";
146      $q .= $db->value_string($this->_date) . ", ";
147      $q .= $db->value_string(timestamp()) . ", ";
148      $q .= $db->value_string(timestamp()) . ", ";
149      $q .= $this->deleted ? "'1'" : "'0'";
150      $q .= " ) ";
151      $db->query($q);
152      $this->_id = $db->insert_id;
153      return true;
154  }
publicmap ( )[ check_db ]
Parameters
No parameters for this method
Code
098  public function map()
099  {
100      $this->_payee = array_key_exists("check:payee",$_REQUEST) ? reqval("check:payee") : $this->_payee;
101      $this->_check_number = array_key_exists("check:check_number",$_REQUEST) ? reqval("check:check_number") : $this->_check_number;
102      $this->_memo = array_key_exists("check:memo",$_REQUEST) ? reqval("check:memo") : $this->_memo;
103      $this->_check_type_id = array_key_exists("check:check_type_id",$_REQUEST) ? reqval("check:check_type_id") : $this->_check_type_id;
104      $this->_date = array_key_exists("check:date",$_REQUEST) ? reqval("check:date") : $this->_date;
105      $this->_mdate = array_key_exists("check:mdate",$_REQUEST) ? reqval("check:mdate") : $this->_mdate;
106      $this->_cdate = array_key_exists("check:cdate",$_REQUEST) ? reqval("check:cdate") : $this->_cdate;
107      $this->_deleted = array_key_exists("check:deleted",$_REQUEST) ? reqval("check:deleted") : $this->_deleted;
108  }
publicpurge ( )[ check_db ]
Parameters
No parameters for this method
Code
194  public function purge()
195  {
196      $db = check::db();
197      $q  = " DELETE FROM com_check ";
198      $q .= " WHERE id = " . $this->_id;
199      $db->query($q);
200      return true;
201  }
public staticsearch ( keyword )[ check_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_bankaccount ( v , type ["default"] )[ check_db ]
Parameters
requiredv
optionaltype ["default"]
Code
408  public function set_bankaccount($__v, $__type="default")
409  {
410      $object = is_null(keyval($this->property_objects_array,"{$__type}_bankaccount")) ? new bankaccount($this->get_bankaccount_id($__type)) : $this->property_objects_array["{$__type}_bankaccount"];
411      if (is_null($__v))
412      {
413          $rel = new bankaccount_check(null,$object->id,$this->id,bankaccount_check::type_id($__type));
414          $rel->delete();
415          if (!is_null(keyval($this->property_objects_array,"{$__type}_bankaccount")))
416          {
417              $this->property_objects_array["{$__type}_bankaccount"] = null;
418          }
419      }
420      else
421      {
422          $id = $object->id;
423          $object = $__v;
424          $object->id = $__v->id>0 ? $__v->id : $id;
425          $object->commit();
426          $this->set_bankaccount_ids(array($object->id),$__type);
427      }
428  }
publicset_bankaccount_id ( v , type ["default"] )[ check_db ]
Parameters
requiredv
optionaltype ["default"]
Code
429  public function set_bankaccount_id($__v, $__type="default")
430  {
431      $this->set_bankaccount_ids(array($__v),$__type);
432  }
publicset_bankaccount_ids ( v , type ["default"] )[ check_db ]
Parameters
requiredv
optionaltype ["default"]
Code
433  public function set_bankaccount_ids($__v, $__type="default")
434  {
435      if ($this->id == 0)
436      {
437          $this->commit();
438      }
439      $type_id = bankaccount_check::type_id($__type);
440      bankaccount_check::delete_all(null,$this->id,$type_id);
441      if (is_array($__v))
442      {
443          foreach ($__v as $index=>$id)
444          {
445              $object = new bankaccount_check(null,$id,$this->id,$type_id);
446              $object->deleted = false;
447              $object->bankaccount_check_type_id = $type_id;
448              $object->commit();
449              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_bankaccount")))
450              {
451                  $this->property_objects_array["{$__type}_bankaccount"] = new bankaccount($object->bankaccount_id);
452              }
453          }
454          $this->_dirty = true;
455      }
456  }
publicset_bankaccount_list ( v , type ["default"] )[ check_db ]
Parameters
requiredv
optionaltype ["default"]
Code
457  public function set_bankaccount_list($__v, $__type="default")
458  {
459      if (is_array($__v))
460      {
461          $ids = array();
462          foreach ($__v as $index=>$object)
463          {
464              $ids[] = $object->id;
465          }
466          $this->set_bankaccount_ids($ids,$__type);
467      }
468  }
publicset_check_type ( v )[ check_db ]
Parameters
requiredv
Code
363  public function set_check_type($v)
364  {
365      if ($v->id > 0)
366      {
367          $this->check_type_id = $v->id;
368      }
369  }
publicset_type ( v )[ check_db ]
Parameters
requiredv
Code
353  public function set_type($v)
354  {
355      $type = new check_type(null, $v);
356      $this->check_type_id = $type->id;
357  }
public__toString ( )[ check_db ]
Parameters
No parameters for this method
Code
337  public function __toString()
338  {
339      return (is_null($this->id) ? "" : $this->id);
340  }
public statictype_id ( type_name )[ check_db ]
Parameters
requiredtype_name
Code
342  public static function type_id($__type_name)
343  {
344      $type = new check_type(null, $__type_name);
345      return $type->id;
346  }
publicundelete ( )[ check_db ]
Parameters
No parameters for this method
Code
183  public function undelete()
184  {
185      $db = check::db();
186      $q  = " UPDATE com_check SET ";
187      $q .= " deleted = 0 ";
188      $q .= " WHERE id = " . $this->_id;
189      $db->query($q);
190      $this->deleted = false;
191      return true;
192  }
protectedupdate ( )[ check_db ]
Parameters
No parameters for this method
Code
156  protected function update()
157  {
158      $db = check::db();
159      $q  = " UPDATE com_check SET ";
160      $q .= $db->param_string("payee") . " = " . $db->value_string($this->_payee) . ", ";
161      $q .= $db->param_string("check_number") . " = " . $db->value_string($this->_check_number) . ", ";
162      $q .= $db->param_string("memo") . " = " . $db->value_string($this->_memo) . ", ";
163      $q .= $db->param_string("check_type_id") . " = " . $db->value_string($this->_check_type_id) . ", ";
164      $q .= $db->param_string("date") . " = " . $db->value_string($this->_date) . ", ";
165      $q .= $db->param_string("mdate") . " = " . $db->value_string(timestamp()) . ", ";
166      $q .= $db->param_string("deleted") . " = " . ($this->deleted ? "'1'" : "'0'");
167      $q .= " WHERE id = " . $this->_id;
168      $db->query($q);
169      return true;
170  }
 
Accessors
publicarray[ obj ]
Code
096  public function get_array()
097  {
098      return get_object_vars($this);
099  }
publicbankaccount[ check_db ]
Code
371  public function get_bankaccount($__type="default")
372  {
373      $object = is_null(keyval($this->property_objects_array,"{$__type}_bankaccount")) ? new bankaccount($this->get_bankaccount_id($__type)) : $this->property_objects_array["{$__type}_bankaccount"];
374      $this->property_objects_array["{$__type}_bankaccount"] = $object;
375      return $object;
376  }
Code
408  public function set_bankaccount($__v, $__type="default")
409  {
410      $object = is_null(keyval($this->property_objects_array,"{$__type}_bankaccount")) ? new bankaccount($this->get_bankaccount_id($__type)) : $this->property_objects_array["{$__type}_bankaccount"];
411      if (is_null($__v))
412      {
413          $rel = new bankaccount_check(null,$object->id,$this->id,bankaccount_check::type_id($__type));
414          $rel->delete();
415          if (!is_null(keyval($this->property_objects_array,"{$__type}_bankaccount")))
416          {
417              $this->property_objects_array["{$__type}_bankaccount"] = null;
418          }
419      }
420      else
421      {
422          $id = $object->id;
423          $object = $__v;
424          $object->id = $__v->id>0 ? $__v->id : $id;
425          $object->commit();
426          $this->set_bankaccount_ids(array($object->id),$__type);
427      }
428  }
publicbankaccount_id[ check_db ]
Code
377  public function get_bankaccount_id($__type="default")
378  {
379      $ids = $this->get_bankaccount_ids($__type, true);
380      return (count($ids)==1 ? $ids[0] : null);
381  }
Code
429  public function set_bankaccount_id($__v, $__type="default")
430  {
431      $this->set_bankaccount_ids(array($__v),$__type);
432  }
publicbankaccount_ids[ check_db ]
Code
382  public function get_bankaccount_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
383  {
384      $bankaccount_ids = array();
385      $db = check::db();
386      $q  = " SELECT com_bankaccount.paymentaccount_id FROM com_bankaccount_check INNER JOIN com_bankaccount ON com_bankaccount_check.bankaccount_paymentaccount_id=com_bankaccount.paymentaccount_id AND com_bankaccount_check.deleted=0 AND com_bankaccount.deleted=0 AND com_bankaccount_check.check_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 " : "");
387      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
388      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
389      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
390      $db->query($q);
391      while ($db->next_record())
392      {
393          $bankaccount_ids[] = $db->f("paymentaccount_id");
394      }
395      return $bankaccount_ids;
396  }
Code
433  public function set_bankaccount_ids($__v, $__type="default")
434  {
435      if ($this->id == 0)
436      {
437          $this->commit();
438      }
439      $type_id = bankaccount_check::type_id($__type);
440      bankaccount_check::delete_all(null,$this->id,$type_id);
441      if (is_array($__v))
442      {
443          foreach ($__v as $index=>$id)
444          {
445              $object = new bankaccount_check(null,$id,$this->id,$type_id);
446              $object->deleted = false;
447              $object->bankaccount_check_type_id = $type_id;
448              $object->commit();
449              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_bankaccount")))
450              {
451                  $this->property_objects_array["{$__type}_bankaccount"] = new bankaccount($object->bankaccount_id);
452              }
453          }
454          $this->_dirty = true;
455      }
456  }
publicbankaccount_list[ check_db ]
Code
397  public function get_bankaccount_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
398  {
399      $ids = $this->get_bankaccount_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
400      $objects = array();
401      foreach ($ids as $index=>$id)
402      {
403          $objects[$index] = new bankaccount($id);
404      }
405      return $objects;
406  }
Code
457  public function set_bankaccount_list($__v, $__type="default")
458  {
459      if (is_array($__v))
460      {
461          $ids = array();
462          foreach ($__v as $index=>$object)
463          {
464              $ids[] = $object->id;
465          }
466          $this->set_bankaccount_ids($ids,$__type);
467      }
468  }
publiccheck_type[ check_db ]
Code
359  public function get_check_type()
360  {
361      return new check_type($this->check_type_id);
362  }
Code
363  public function set_check_type($v)
364  {
365      if ($v->id > 0)
366      {
367          $this->check_type_id = $v->id;
368      }
369  }
publicclassname[ obj ]
Code
086  public function get_classname()
087  {
088      return get_class($this);
089  }
publiccolumns[ check_db ]
Code
203  public static function get_columns($__columns, $__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
204  {
205      $lookups = is_array($__lookups) ? $__lookups : array($__lookups);
206      $colarray = is_array($__columns) ? $__columns : explode(",",$__columns);
207      $colstring = is_array($__columns) ? implode(",",$__columns) : $__columns;
208 
209      $db = check::db();
210      $data = array();
211      $q  = " SELECT $colstring ";
212      $q .= " FROM com_check ";
213      $q .= " WHERE com_check.deleted = 0 ";
214      $q .= is_null($__where_clause) ? null : " AND ($__where_clause) ";
215      $q .= array_key_exists("check_type_id",$lookups) ? " AND com_check.check_type_id='" . $lookups["check_type_id"] . "' " : "";
216 
217      if (is_string($__order))
218      {
219          $q .= "ORDER BY " . $__order;
220      }
221      else if (is_array($__order) and count($__order)>0)
222      {
223          $orderings = array();
224          foreach ($__order as $col=>$dir)
225          {
226              $orderings[] = " $col $dir ";
227          }
228          $q .= "ORDER BY " . implode(", ", $orderings);
229      }
230      else if (is_object($__order))
231      {
232          $q .= "";
233      }
234      else
235      {
236          // THERE IS NO `order` COLUMN ON THIS OBJECT
237      }
238 
239      if (!is_null($__limit))
240      {
241          $q .= " LIMIT $__offset , $__limit ";
242      }
243 
244      $db->query($q);
245 
246      if (count($colarray)>1 || $colstring=="*")
247      {
248          while ($db->next_record())
249          {
250              $data[] = $db->record;
251          }
252      }
253      else
254      {
255          while ($db->next_record())
256          {
257              $data[] = $db->f(0);
258          }
259      }
260 
261      return $data;
262  }
publicdirty[ obj ]
Code
063  public function get_dirty()
064  {
065      if ($this->id === 0)
066      {
067          $this->_dirty = true;
068      }
069      else
070      {
071          foreach (get_object_vars($this) as $k=>$v)
072          {
073              if ($this->_dirty)
074              {
075                  break;
076              }
077              if (preg_match('/_dirty$/',$k))
078              {
079                  $this->_dirty = $this->_dirty || $v;
080              }
081          }
082      }
083      return $this->_dirty;
084  }
publicids[ check_db ]
Code
264  public static function get_ids($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
265  {
266      return check::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset);
267  }
publicjson[ obj ]
Code
101  public function get_json()
102  {
103      $class = new ReflectionClass($this->classname);
104      $methods = $class->getMethods();
105      usort($methods,"sort_reflection_objects");
106      $accessors = array();
107      foreach ($methods as $index=>$method)
108      {
109          $declarer = $method->getDeclaringClass()->name;
110          if (preg_match('/^(get|set|)_(.+)$/',$method->name,$matches))
111          {
112              $accessor = $matches[2];
113              $getset = $matches[1];
114              eval("\$accessors[\$accessor] = \$this->".$accessor.";");
115          }
116      }
117      //return json_encode($this->get_array());
118      return json_encode($accessors);
119  }
publicobjects[ check_db ]
Code
269  public static function get_objects($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
270  {
271      $objects = array();
272      foreach (check::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset) as $id)
273      {
274          $objects[] = new check($id);
275      }
276      return $objects;
277  }
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[ check_db ]
Code
348  public function get_type()
349  {
350      $type = new check_type($this->_check_type_id);
351      return $type->name;
352  }
Code
353  public function set_type($v)
354  {
355      $type = new check_type(null, $v);
356      $this->check_type_id = $type->id;
357  }
Get Helix PHP Framework at SourceForge.net. Fast, secure and Free Open Source software downloads