Helix Installation   Getting Started   Reference Documentation   Global Functions   Quick Start
ModulesClassesFunctions
 

Class Reference

class paymentstatus extends paymentstatus_ext

Hide Inherited MembersE-Commerce
Description
No description.
 
Constants
constantTABLENAME ["com_paymentstatus"][ paymentstatus ]
 
Properties
protected_cdate[ paymentstatus_db ]
protected_cdate_dirty[ paymentstatus_db ]
protected_deleted[ paymentstatus_db ]
protected_deleted_dirty[ paymentstatus_db ]
protected_description[ paymentstatus_db ]
protected_description_dirty[ paymentstatus_db ]
protected_dirty[ obj ]
protected_id[ paymentstatus_db ]
protected_id_dirty[ paymentstatus_db ]
protected_mdate[ paymentstatus_db ]
protected_mdate_dirty[ paymentstatus_db ]
publicproperty_objects_array[ obj ]
 
Methods
publiccommit ( )[ paymentstatus_db ]
Parameters
No parameters for this method
Code
086  public function commit()
087  {
088      if ($this->_id > 0)
089      {
090          $this->update();
091      }
092      else
093      {
094          $this->insert();
095      }
096 
097      foreach ($this->property_objects_array as $property=>$object)
098      {
099          $this->{$property} = $object;
100      }
101 
102      return true;
103  }
public__construct ( id )[ paymentstatus_db ]
Parameters
optionalid
Code
040  public function __construct($__id=null)
041  {
042      $this->_id = 0;
043      $this->_description = "";
044      $this->_mdate = null;
045      $this->_cdate = null;
046      $this->_deleted = false;
047 
048      $this->_id_dirty = false;
049      $this->_description_dirty = false;
050      $this->_mdate_dirty = false;
051      $this->_cdate_dirty = false;
052      $this->_deleted_dirty = false;
053 
054      if (is_null($__id))
055      {
056          return;
057      }
058 
059      $db = paymentstatus::db();
060      $q  = " SELECT com_paymentstatus.id,com_paymentstatus.description,com_paymentstatus.mdate,com_paymentstatus.cdate,com_paymentstatus.deleted ";
061      $q .= " FROM com_paymentstatus ";       
062      if (!is_null($__id))
063      {
064          $q .= " WHERE id = '$__id' ";
065      }
066 
067      $db->query($q);
068      if ($db->next_record() && $db->num_rows() == 1)
069      {
070          $this->_id = $db->f("id");
071          $this->_description = $db->f("description");
072          $this->_mdate = $db->f("mdate");
073          $this->_cdate = $db->f("cdate");
074          $this->_deleted = $db->f("deleted");
075      }
076  }
protected staticdb ( )[ paymentstatus_db ]
Parameters
No parameters for this method
Code
305  protected static function db()
306  {
307      return new db();
308  }
publicdelete ( )[ paymentstatus_db ]
Parameters
No parameters for this method
Code
136  public function delete()
137  {
138      $db = paymentstatus::db();
139      $q  = " UPDATE com_paymentstatus SET ";
140      $q .= " deleted = 1 ";
141      $q .= " WHERE id = " . $this->_id;
142      $db->query($q);
143      $this->deleted = true;
144      return true;
145  }
public staticdelete_all ( )[ paymentstatus_db ]
Parameters
No parameters for this method
Code
242  public static function delete_all()
243  {
244      $db = paymentstatus::db();
245      $q  = " UPDATE com_paymentstatus SET ";
246      $q .= " deleted = 1 ";
247     
248      $db->query($q);
249      return true;
250  }
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] )[ paymentstatus_db ]
Parameters
requiredcolumns
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
167  public static function get_columns($__columns, $__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
168  {
169      $lookups = is_array($__lookups) ? $__lookups : array($__lookups);
170      $colarray = is_array($__columns) ? $__columns : explode(",",$__columns);
171      $colstring = is_array($__columns) ? implode(",",$__columns) : $__columns;
172 
173      $db = paymentstatus::db();
174      $data = array();
175      $q  = " SELECT $colstring ";
176      $q .= " FROM com_paymentstatus ";
177      $q .= " WHERE com_paymentstatus.deleted = 0 ";
178      $q .= is_null($__where_clause) ? null : " AND ($__where_clause) ";
179 
180      if (is_string($__order))
181      {
182          $q .= "ORDER BY " . $__order;
183      }
184      else if (is_array($__order) and count($__order)>0)
185      {
186          $orderings = array();
187          foreach ($__order as $col=>$dir)
188          {
189              $orderings[] = " $col $dir ";
190          }
191          $q .= "ORDER BY " . implode(", ", $orderings);
192      }
193      else if (is_object($__order))
194      {
195          $q .= "";
196      }
197      else
198      {
199          // THERE IS NO `order` COLUMN ON THIS OBJECT
200      }
201 
202      if (!is_null($__limit))
203      {
204          $q .= " LIMIT $__offset , $__limit ";
205      }
206 
207      $db->query($q);
208 
209      if (count($colarray)>1 || $colstring=="*")
210      {
211          while ($db->next_record())
212          {
213              $data[] = $db->record;
214          }
215      }
216      else
217      {
218          while ($db->next_record())
219          {
220              $data[] = $db->f(0);
221          }
222      }
223 
224      return $data;
225  }
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] )[ paymentstatus_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
227  public static function get_ids($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
228  {
229      return paymentstatus::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset);
230  }
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] )[ paymentstatus_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
232  public static function get_objects($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
233  {
234      $objects = array();
235      foreach (paymentstatus::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset) as $id)
236      {
237          $objects[] = new paymentstatus($id);
238      }
239      return $objects;
240  }
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 ( )[ paymentstatus_db ]
Parameters
No parameters for this method
Code
105  protected function insert()
106  {
107      $db = paymentstatus::db();
108      $q  = " INSERT INTO com_paymentstatus ( ";
109      $q .= $db->param_string("description") . ", ";
110      $q .= $db->param_string("mdate") . ", ";
111      $q .= $db->param_string("cdate") . ", ";
112      $q .= $db->param_string("deleted");
113      $q .= " ) VALUES ( ";
114      $q .= $db->value_string($this->_description) . ", ";
115      $q .= $db->value_string(timestamp()) . ", ";
116      $q .= $db->value_string(timestamp()) . ", ";
117      $q .= $this->deleted ? "'1'" : "'0'";
118      $q .= " ) ";
119      $db->query($q);
120      $this->_id = $db->insert_id;
121      return true;
122  }
publicmap ( )[ paymentstatus_db ]
Parameters
No parameters for this method
Code
078  public function map()
079  {
080      $this->_description = array_key_exists("paymentstatus:description",$_REQUEST) ? reqval("paymentstatus:description") : $this->_description;
081      $this->_mdate = array_key_exists("paymentstatus:mdate",$_REQUEST) ? reqval("paymentstatus:mdate") : $this->_mdate;
082      $this->_cdate = array_key_exists("paymentstatus:cdate",$_REQUEST) ? reqval("paymentstatus:cdate") : $this->_cdate;
083      $this->_deleted = array_key_exists("paymentstatus:deleted",$_REQUEST) ? reqval("paymentstatus:deleted") : $this->_deleted;
084  }
publicpurge ( )[ paymentstatus_db ]
Parameters
No parameters for this method
Code
158  public function purge()
159  {
160      $db = paymentstatus::db();
161      $q  = " DELETE FROM com_paymentstatus ";
162      $q .= " WHERE id = " . $this->_id;
163      $db->query($q);
164      return true;
165  }
public staticsearch ( keyword )[ paymentstatus_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 ( )[ paymentstatus_db ]
Parameters
No parameters for this method
Code
300  public function __toString()
301  {
302      return (is_null($this->description) ? "" : $this->description);
303  }
publicundelete ( )[ paymentstatus_db ]
Parameters
No parameters for this method
Code
147  public function undelete()
148  {
149      $db = paymentstatus::db();
150      $q  = " UPDATE com_paymentstatus SET ";
151      $q .= " deleted = 0 ";
152      $q .= " WHERE id = " . $this->_id;
153      $db->query($q);
154      $this->deleted = false;
155      return true;
156  }
protectedupdate ( )[ paymentstatus_db ]
Parameters
No parameters for this method
Code
124  protected function update()
125  {
126      $db = paymentstatus::db();
127      $q  = " UPDATE com_paymentstatus SET ";
128      $q .= $db->param_string("description") . " = " . $db->value_string($this->_description) . ", ";
129      $q .= $db->param_string("mdate") . " = " . $db->value_string(timestamp()) . ", ";
130      $q .= $db->param_string("deleted") . " = " . ($this->deleted ? "'1'" : "'0'");
131      $q .= " WHERE id = " . $this->_id;
132      $db->query($q);
133      return true;
134  }
 
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[ paymentstatus_db ]
Code
167  public static function get_columns($__columns, $__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
168  {
169      $lookups = is_array($__lookups) ? $__lookups : array($__lookups);
170      $colarray = is_array($__columns) ? $__columns : explode(",",$__columns);
171      $colstring = is_array($__columns) ? implode(",",$__columns) : $__columns;
172 
173      $db = paymentstatus::db();
174      $data = array();
175      $q  = " SELECT $colstring ";
176      $q .= " FROM com_paymentstatus ";
177      $q .= " WHERE com_paymentstatus.deleted = 0 ";
178      $q .= is_null($__where_clause) ? null : " AND ($__where_clause) ";
179 
180      if (is_string($__order))
181      {
182          $q .= "ORDER BY " . $__order;
183      }
184      else if (is_array($__order) and count($__order)>0)
185      {
186          $orderings = array();
187          foreach ($__order as $col=>$dir)
188          {
189              $orderings[] = " $col $dir ";
190          }
191          $q .= "ORDER BY " . implode(", ", $orderings);
192      }
193      else if (is_object($__order))
194      {
195          $q .= "";
196      }
197      else
198      {
199          // THERE IS NO `order` COLUMN ON THIS OBJECT
200      }
201 
202      if (!is_null($__limit))
203      {
204          $q .= " LIMIT $__offset , $__limit ";
205      }
206 
207      $db->query($q);
208 
209      if (count($colarray)>1 || $colstring=="*")
210      {
211          while ($db->next_record())
212          {
213              $data[] = $db->record;
214          }
215      }
216      else
217      {
218          while ($db->next_record())
219          {
220              $data[] = $db->f(0);
221          }
222      }
223 
224      return $data;
225  }
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[ paymentstatus_db ]
Code
227  public static function get_ids($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
228  {
229      return paymentstatus::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset);
230  }
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[ paymentstatus_db ]
Code
232  public static function get_objects($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
233  {
234      $objects = array();
235      foreach (paymentstatus::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset) as $id)
236      {
237          $objects[] = new paymentstatus($id);
238      }
239      return $objects;
240  }
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