Helix Installation   Getting Started   Reference Documentation   Global Functions   Quick Start
ModulesClassesFunctions
 

Class Reference

class ach_bankaccount_type extends ach_bankaccount_type_ext

Hide Inherited MembersE-Commerce
Description
No description.
 
Constants
constantTABLENAME ["com_ach_bankaccount_type"][ ach_bankaccount_type ]
 
Properties
protected_cdate[ ach_bankaccount_type_db ]
protected_cdate_dirty[ ach_bankaccount_type_db ]
protected_deleted[ ach_bankaccount_type_db ]
protected_deleted_dirty[ ach_bankaccount_type_db ]
protected_description[ ach_bankaccount_type_db ]
protected_description_dirty[ ach_bankaccount_type_db ]
protected_dirty[ obj ]
protected_id[ ach_bankaccount_type_db ]
protected_id_dirty[ ach_bankaccount_type_db ]
protected_mdate[ ach_bankaccount_type_db ]
protected_mdate_dirty[ ach_bankaccount_type_db ]
protected_name[ ach_bankaccount_type_db ]
protected_name_dirty[ ach_bankaccount_type_db ]
publicproperty_objects_array[ obj ]
 
Methods
publiccommit ( )[ ach_bankaccount_type_db ]
Parameters
No parameters for this method
Code
096  public function commit()
097  {
098      if ($this->_id > 0)
099      {
100          $this->update();
101      }
102      else
103      {
104          $this->insert();
105      }
106 
107      foreach ($this->property_objects_array as $property=>$object)
108      {
109          $this->{$property} = $object;
110      }
111 
112      return true;
113  }
public__construct ( id , name )[ ach_bankaccount_type_db ]
Parameters
optionalid
optionalname
Code
042  public function __construct($__id=null, $__name=null)
043  {
044      $this->_id = 0;
045      $this->_name = $__name;
046      $this->_description = "";
047      $this->_mdate = null;
048      $this->_cdate = null;
049      $this->_deleted = false;
050 
051      $this->_id_dirty = false;
052      $this->_name_dirty = false;
053      $this->_description_dirty = false;
054      $this->_mdate_dirty = false;
055      $this->_cdate_dirty = false;
056      $this->_deleted_dirty = false;
057 
058      if (is_null($__id) && is_null($__name))
059      {
060          return;
061      }
062 
063      $db = ach_bankaccount_type::db();
064      $q  = " SELECT com_ach_bankaccount_type.id,com_ach_bankaccount_type.name,com_ach_bankaccount_type.description,com_ach_bankaccount_type.mdate,com_ach_bankaccount_type.cdate,com_ach_bankaccount_type.deleted ";
065      $q .= " FROM com_ach_bankaccount_type ";       
066      if (!is_null($__id))
067      {
068          $q .= " WHERE id = '$__id' ";
069      }
070      else if (!is_null($__name))
071      {
072          $q .= " WHERE name = '$__name' ";
073      }
074 
075      $db->query($q);
076      if ($db->next_record() && $db->num_rows() == 1)
077      {
078          $this->_id = $db->f("id");
079          $this->_name = $db->f("name");
080          $this->_description = $db->f("description");
081          $this->_mdate = $db->f("mdate");
082          $this->_cdate = $db->f("cdate");
083          $this->_deleted = $db->f("deleted");
084      }
085  }
protected staticdb ( )[ ach_bankaccount_type_db ]
Parameters
No parameters for this method
Code
318  protected static function db()
319  {
320      return new db();
321  }
publicdelete ( )[ ach_bankaccount_type_db ]
Parameters
No parameters for this method
Code
149  public function delete()
150  {
151      $db = ach_bankaccount_type::db();
152      $q  = " UPDATE com_ach_bankaccount_type SET ";
153      $q .= " deleted = 1 ";
154      $q .= " WHERE id = " . $this->_id;
155      $db->query($q);
156      $this->deleted = true;
157      return true;
158  }
public staticdelete_all ( )[ ach_bankaccount_type_db ]
Parameters
No parameters for this method
Code
255  public static function delete_all()
256  {
257      $db = ach_bankaccount_type::db();
258      $q  = " UPDATE com_ach_bankaccount_type SET ";
259      $q .= " deleted = 1 ";
260     
261      $db->query($q);
262      return true;
263  }
public__get ( p )[ obj ]
Parameters
requiredp
Code
007  public function __get($p)
008  {
009      $methods = get_class_methods($this);
010      $properties = get_object_vars($this);
011      if (in_array("get_$p",$methods))
012      {
013          return $this->{"get_$p"}();
014      }
015      else if (array_key_exists("_$p",$properties))
016      {
017          return $this->{"_$p"};
018      }
019      else if (in_array("get_" . substr($p,strpos($p,"_")+1), $methods))
020      {
021          return $this->{"get_" . substr($p,strpos($p,"_")+1)}(substr($p,0,strpos($p,"_")));
022      }
023      else
024      {
025          trigger_error("This object [" . get_class($this) . ":$this->id] has no private property '_$p' for the requested public property '$p'",E_USER_WARNING);
026          return null;
027      }
028  }
publicget_array ( )[ obj ]
Parameters
No parameters for this method
Code
096  public function get_array()
097  {
098      return get_object_vars($this);
099  }
publicget_classname ( )[ obj ]
Parameters
No parameters for this method
Code
086  public function get_classname()
087  {
088      return get_class($this);
089  }
public staticget_columns ( columns , order , lookups , where_clause , limit , offset [0] )[ ach_bankaccount_type_db ]
Parameters
requiredcolumns
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
180  public static function get_columns($__columns, $__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
181  {
182      $lookups = is_array($__lookups) ? $__lookups : array($__lookups);
183      $colarray = is_array($__columns) ? $__columns : explode(",",$__columns);
184      $colstring = is_array($__columns) ? implode(",",$__columns) : $__columns;
185 
186      $db = ach_bankaccount_type::db();
187      $data = array();
188      $q  = " SELECT $colstring ";
189      $q .= " FROM com_ach_bankaccount_type ";
190      $q .= " WHERE com_ach_bankaccount_type.deleted = 0 ";
191      $q .= is_null($__where_clause) ? null : " AND ($__where_clause) ";
192 
193      if (is_string($__order))
194      {
195          $q .= "ORDER BY " . $__order;
196      }
197      else if (is_array($__order) and count($__order)>0)
198      {
199          $orderings = array();
200          foreach ($__order as $col=>$dir)
201          {
202              $orderings[] = " $col $dir ";
203          }
204          $q .= "ORDER BY " . implode(", ", $orderings);
205      }
206      else if (is_object($__order))
207      {
208          $q .= "";
209      }
210      else
211      {
212          // THERE IS NO `order` COLUMN ON THIS OBJECT
213      }
214 
215      if (!is_null($__limit))
216      {
217          $q .= " LIMIT $__offset , $__limit ";
218      }
219 
220      $db->query($q);
221 
222      if (count($colarray)>1 || $colstring=="*")
223      {
224          while ($db->next_record())
225          {
226              $data[] = $db->record;
227          }
228      }
229      else
230      {
231          while ($db->next_record())
232          {
233              $data[] = $db->f(0);
234          }
235      }
236 
237      return $data;
238  }
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] )[ ach_bankaccount_type_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
240  public static function get_ids($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
241  {
242      return ach_bankaccount_type::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset);
243  }
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] )[ ach_bankaccount_type_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
245  public static function get_objects($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
246  {
247      $objects = array();
248      foreach (ach_bankaccount_type::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset) as $id)
249      {
250          $objects[] = new ach_bankaccount_type($id);
251      }
252      return $objects;
253  }
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  }
protectedinsert ( )[ ach_bankaccount_type_db ]
Parameters
No parameters for this method
Code
115  protected function insert()
116  {
117      $db = ach_bankaccount_type::db();
118      $q  = " INSERT INTO com_ach_bankaccount_type ( ";
119      $q .= $db->param_string("name") . ", ";
120      $q .= $db->param_string("description") . ", ";
121      $q .= $db->param_string("mdate") . ", ";
122      $q .= $db->param_string("cdate") . ", ";
123      $q .= $db->param_string("deleted");
124      $q .= " ) VALUES ( ";
125      $q .= $db->value_string($this->_name) . ", ";
126      $q .= $db->value_string($this->_description) . ", ";
127      $q .= $db->value_string(timestamp()) . ", ";
128      $q .= $db->value_string(timestamp()) . ", ";
129      $q .= $this->deleted ? "'1'" : "'0'";
130      $q .= " ) ";
131      $db->query($q);
132      $this->_id = $db->insert_id;
133      return true;
134  }
publicmap ( )[ ach_bankaccount_type_db ]
Parameters
No parameters for this method
Code
087  public function map()
088  {
089      $this->_name = array_key_exists("ach_bankaccount_type:name",$_REQUEST) ? reqval("ach_bankaccount_type:name") : $this->_name;
090      $this->_description = array_key_exists("ach_bankaccount_type:description",$_REQUEST) ? reqval("ach_bankaccount_type:description") : $this->_description;
091      $this->_mdate = array_key_exists("ach_bankaccount_type:mdate",$_REQUEST) ? reqval("ach_bankaccount_type:mdate") : $this->_mdate;
092      $this->_cdate = array_key_exists("ach_bankaccount_type:cdate",$_REQUEST) ? reqval("ach_bankaccount_type:cdate") : $this->_cdate;
093      $this->_deleted = array_key_exists("ach_bankaccount_type:deleted",$_REQUEST) ? reqval("ach_bankaccount_type:deleted") : $this->_deleted;
094  }
publicpurge ( )[ ach_bankaccount_type_db ]
Parameters
No parameters for this method
Code
171  public function purge()
172  {
173      $db = ach_bankaccount_type::db();
174      $q  = " DELETE FROM com_ach_bankaccount_type ";
175      $q .= " WHERE id = " . $this->_id;
176      $db->query($q);
177      return true;
178  }
public staticsearch ( keyword )[ ach_bankaccount_type_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  }
public__toString ( )[ ach_bankaccount_type_db ]
Parameters
No parameters for this method
Code
313  public function __toString()
314  {
315      return (is_null($this->name) ? "" : $this->name);
316  }
publicundelete ( )[ ach_bankaccount_type_db ]
Parameters
No parameters for this method
Code
160  public function undelete()
161  {
162      $db = ach_bankaccount_type::db();
163      $q  = " UPDATE com_ach_bankaccount_type SET ";
164      $q .= " deleted = 0 ";
165      $q .= " WHERE id = " . $this->_id;
166      $db->query($q);
167      $this->deleted = false;
168      return true;
169  }
protectedupdate ( )[ ach_bankaccount_type_db ]
Parameters
No parameters for this method
Code
136  protected function update()
137  {
138      $db = ach_bankaccount_type::db();
139      $q  = " UPDATE com_ach_bankaccount_type SET ";
140      $q .= $db->param_string("name") . " = " . $db->value_string($this->_name) . ", ";
141      $q .= $db->param_string("description") . " = " . $db->value_string($this->_description) . ", ";
142      $q .= $db->param_string("mdate") . " = " . $db->value_string(timestamp()) . ", ";
143      $q .= $db->param_string("deleted") . " = " . ($this->deleted ? "'1'" : "'0'");
144      $q .= " WHERE id = " . $this->_id;
145      $db->query($q);
146      return true;
147  }
 
Accessors
publicarray[ obj ]
Code
096  public function get_array()
097  {
098      return get_object_vars($this);
099  }
publicclassname[ obj ]
Code
086  public function get_classname()
087  {
088      return get_class($this);
089  }
publiccolumns[ ach_bankaccount_type_db ]
Code
180  public static function get_columns($__columns, $__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
181  {
182      $lookups = is_array($__lookups) ? $__lookups : array($__lookups);
183      $colarray = is_array($__columns) ? $__columns : explode(",",$__columns);
184      $colstring = is_array($__columns) ? implode(",",$__columns) : $__columns;
185 
186      $db = ach_bankaccount_type::db();
187      $data = array();
188      $q  = " SELECT $colstring ";
189      $q .= " FROM com_ach_bankaccount_type ";
190      $q .= " WHERE com_ach_bankaccount_type.deleted = 0 ";
191      $q .= is_null($__where_clause) ? null : " AND ($__where_clause) ";
192 
193      if (is_string($__order))
194      {
195          $q .= "ORDER BY " . $__order;
196      }
197      else if (is_array($__order) and count($__order)>0)
198      {
199          $orderings = array();
200          foreach ($__order as $col=>$dir)
201          {
202              $orderings[] = " $col $dir ";
203          }
204          $q .= "ORDER BY " . implode(", ", $orderings);
205      }
206      else if (is_object($__order))
207      {
208          $q .= "";
209      }
210      else
211      {
212          // THERE IS NO `order` COLUMN ON THIS OBJECT
213      }
214 
215      if (!is_null($__limit))
216      {
217          $q .= " LIMIT $__offset , $__limit ";
218      }
219 
220      $db->query($q);
221 
222      if (count($colarray)>1 || $colstring=="*")
223      {
224          while ($db->next_record())
225          {
226              $data[] = $db->record;
227          }
228      }
229      else
230      {
231          while ($db->next_record())
232          {
233              $data[] = $db->f(0);
234          }
235      }
236 
237      return $data;
238  }
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[ ach_bankaccount_type_db ]
Code
240  public static function get_ids($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
241  {
242      return ach_bankaccount_type::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset);
243  }
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[ ach_bankaccount_type_db ]
Code
245  public static function get_objects($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
246  {
247      $objects = array();
248      foreach (ach_bankaccount_type::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset) as $id)
249      {
250          $objects[] = new ach_bankaccount_type($id);
251      }
252      return $objects;
253  }
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  }
Get Helix PHP Framework at SourceForge.net. Fast, secure and Free Open Source software downloads