Helix Installation   Getting Started   Reference Documentation   Global Functions   Quick Start
ModulesClassesFunctions
 

Class Reference

class hitqualification extends hitqualification_ext

Hide Inherited MembersAmazon Web Services
Description
No description.
 
Constants
constantTABLENAME ["aws_hitqualification"][ hitqualification ]
 
Properties
protected_cdate[ hitqualification_db ]
protected_cdate_dirty[ hitqualification_db ]
protected_country_id[ hitqualification_db ]
protected_country_id_dirty[ hitqualification_db ]
protected_deleted[ hitqualification_db ]
protected_deleted_dirty[ hitqualification_db ]
protected_dirty[ obj ]
protected_granttime[ hitqualification_db ]
protected_granttime_dirty[ hitqualification_db ]
protected_hitqualificationstatus_id[ hitqualification_db ]
protected_hitqualificationstatus_id_dirty[ hitqualification_db ]
protected_id[ hitqualification_db ]
protected_id_dirty[ hitqualification_db ]
protected_integervalue[ hitqualification_db ]
protected_integervalue_dirty[ hitqualification_db ]
protected_mdate[ hitqualification_db ]
protected_mdate_dirty[ hitqualification_db ]
publicproperty_objects_array[ obj ]
protected_qualificationtypeid[ hitqualification_db ]
protected_qualificationtypeid_dirty[ hitqualification_db ]
protected_requiredtopreview[ hitqualification_db ]
protected_requiredtopreview_dirty[ hitqualification_db ]
 
Methods
publiccommit ( )[ hitqualification_db ]
Parameters
No parameters for this method
Code
116  public function commit()
117  {
118      if ($this->_id > 0)
119      {
120          $this->update();
121      }
122      else
123      {
124          $this->insert();
125      }
126 
127      foreach ($this->property_objects_array as $property=>$object)
128      {
129          $this->{$property} = $object;
130      }
131 
132      return true;
133  }
public__construct ( id )[ hitqualification_db ]
Parameters
optionalid
Code
050  public function __construct($__id=null)
051  {
052      $this->_id = 0;
053      $this->_qualificationtypeid = "";
054      $this->_granttime = null;
055      $this->_integervalue = "";
056      $this->_country_id = 0;
057      $this->_hitqualificationstatus_id = 0;
058      $this->_requiredtopreview = false;
059      $this->_mdate = null;
060      $this->_cdate = null;
061      $this->_deleted = false;
062 
063      $this->_id_dirty = false;
064      $this->_qualificationtypeid_dirty = false;
065      $this->_granttime_dirty = false;
066      $this->_integervalue_dirty = false;
067      $this->_country_id_dirty = false;
068      $this->_hitqualificationstatus_id_dirty = false;
069      $this->_requiredtopreview_dirty = false;
070      $this->_mdate_dirty = false;
071      $this->_cdate_dirty = false;
072      $this->_deleted_dirty = false;
073 
074      if (is_null($__id))
075      {
076          return;
077      }
078 
079      $db = hitqualification::db();
080      $q  = " SELECT aws_hitqualification.id,aws_hitqualification.qualificationtypeid,aws_hitqualification.granttime,aws_hitqualification.integervalue,aws_hitqualification.country_id,aws_hitqualification.hitqualificationstatus_id,aws_hitqualification.requiredtopreview,aws_hitqualification.mdate,aws_hitqualification.cdate,aws_hitqualification.deleted ";
081      $q .= " FROM aws_hitqualification ";       
082      if (!is_null($__id))
083      {
084          $q .= " WHERE id = '$__id' ";
085      }
086 
087      $db->query($q);
088      if ($db->next_record() && $db->num_rows() == 1)
089      {
090          $this->_id = $db->f("id");
091          $this->_qualificationtypeid = $db->f("qualificationtypeid");
092          $this->_granttime = $db->f("granttime");
093          $this->_integervalue = $db->f("integervalue");
094          $this->_country_id = $db->f("country_id");
095          $this->_hitqualificationstatus_id = $db->f("hitqualificationstatus_id");
096          $this->_requiredtopreview = $db->f("requiredtopreview");
097          $this->_mdate = $db->f("mdate");
098          $this->_cdate = $db->f("cdate");
099          $this->_deleted = $db->f("deleted");
100      }
101  }
protected staticdb ( )[ hitqualification_db ]
Parameters
No parameters for this method
Code
574  protected static function db()
575  {
576      return new db();
577  }
publicdelete ( )[ hitqualification_db ]
Parameters
No parameters for this method
Code
181  public function delete()
182  {
183      $db = hitqualification::db();
184      $q  = " UPDATE aws_hitqualification SET ";
185      $q .= " deleted = 1 ";
186      $q .= " WHERE id = " . $this->_id;
187      $db->query($q);
188      $this->deleted = true;
189      return true;
190  }
public staticdelete_all ( )[ hitqualification_db ]
Parameters
No parameters for this method
Code
289  public static function delete_all()
290  {
291      $db = hitqualification::db();
292      $q  = " UPDATE aws_hitqualification SET ";
293      $q .= " deleted = 1 ";
294     
295      $db->query($q);
296      return true;
297  }
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] )[ hitqualification_db ]
Parameters
requiredcolumns
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
212  public static function get_columns($__columns, $__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
213  {
214      $lookups = is_array($__lookups) ? $__lookups : array($__lookups);
215      $colarray = is_array($__columns) ? $__columns : explode(",",$__columns);
216      $colstring = is_array($__columns) ? implode(",",$__columns) : $__columns;
217 
218      $db = hitqualification::db();
219      $data = array();
220      $q  = " SELECT $colstring ";
221      $q .= " FROM aws_hitqualification ";
222      $q .= " WHERE aws_hitqualification.deleted = 0 ";
223      $q .= is_null($__where_clause) ? null : " AND ($__where_clause) ";
224      $q .= array_key_exists("country_id",$lookups) ? " AND aws_hitqualification.country_id='" . $lookups["country_id"] . "' " : "";
225      $q .= array_key_exists("hitqualificationstatus_id",$lookups) ? " AND aws_hitqualification.hitqualificationstatus_id='" . $lookups["hitqualificationstatus_id"] . "' " : "";
226 
227      if (is_string($__order))
228      {
229          $q .= "ORDER BY " . $__order;
230      }
231      else if (is_array($__order) and count($__order)>0)
232      {
233          $orderings = array();
234          foreach ($__order as $col=>$dir)
235          {
236              $orderings[] = " $col $dir ";
237          }
238          $q .= "ORDER BY " . implode(", ", $orderings);
239      }
240      else if (is_object($__order))
241      {
242          $q .= "";
243      }
244      else
245      {
246          // THERE IS NO `order` COLUMN ON THIS OBJECT
247      }
248 
249      if (!is_null($__limit))
250      {
251          $q .= " LIMIT $__offset , $__limit ";
252      }
253 
254      $db->query($q);
255 
256      if (count($colarray)>1 || $colstring=="*")
257      {
258          while ($db->next_record())
259          {
260              $data[] = $db->record;
261          }
262      }
263      else
264      {
265          while ($db->next_record())
266          {
267              $data[] = $db->f(0);
268          }
269      }
270 
271      return $data;
272  }
publicget_country ( )[ hitqualification_db ]
Parameters
No parameters for this method
Code
352  public function get_country()
353  {
354      return new country($this->country_id);
355  }
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_hit ( type ["default"] )[ hitqualification_db ]
Parameters
optionaltype ["default"]
Code
376  public function get_hit($__type="default")
377  {
378      $object = is_null(keyval($this->property_objects_array,"{$__type}_hit")) ? new hit($this->get_hit_id($__type)) : $this->property_objects_array["{$__type}_hit"];
379      $this->property_objects_array["{$__type}_hit"] = $object;
380      return $object;
381  }
publicget_hit_id ( type ["default"] )[ hitqualification_db ]
Parameters
optionaltype ["default"]
Code
382  public function get_hit_id($__type="default")
383  {
384      $ids = $this->get_hit_ids($__type, true);
385      return (count($ids)==1 ? $ids[0] : null);
386  }
publicget_hit_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ hitqualification_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
387  public function get_hit_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
388  {
389      $hit_ids = array();
390      $db = hitqualification::db();
391      $q  = " SELECT aws_hit.id FROM aws_hit_hitqualification INNER JOIN aws_hit ON aws_hit_hitqualification.hit_id=aws_hit.id AND aws_hit_hitqualification.deleted=0 AND aws_hit.deleted=0 AND aws_hit_hitqualification.hitqualification_id='$this->id' " . (is_null($__type) ? "" : " AND aws_hit_hitqualification.hit_hitqualification_type_id='" . hit_hitqualification::type_id($__type) . "'") . ($__get_primary ? " AND aws_hit_hitqualification.primary=1 " : "");
392      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
393      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
394      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
395      $db->query($q);
396      while ($db->next_record())
397      {
398          $hit_ids[] = $db->f("id");
399      }
400      return $hit_ids;
401  }
publicget_hit_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ hitqualification_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
402  public function get_hit_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
403  {
404      $ids = $this->get_hit_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
405      $objects = array();
406      foreach ($ids as $index=>$id)
407      {
408          $objects[$index] = new hit($id);
409      }
410      return $objects;
411  }
publicget_hitqualificationstatus ( )[ hitqualification_db ]
Parameters
No parameters for this method
Code
364  public function get_hitqualificationstatus()
365  {
366      return new hitqualificationstatus($this->hitqualificationstatus_id);
367  }
publicget_hittemplate ( type ["default"] )[ hitqualification_db ]
Parameters
optionaltype ["default"]
Code
475  public function get_hittemplate($__type="default")
476  {
477      $object = is_null(keyval($this->property_objects_array,"{$__type}_hittemplate")) ? new hittemplate($this->get_hittemplate_id($__type)) : $this->property_objects_array["{$__type}_hittemplate"];
478      $this->property_objects_array["{$__type}_hittemplate"] = $object;
479      return $object;
480  }
publicget_hittemplate_id ( type ["default"] )[ hitqualification_db ]
Parameters
optionaltype ["default"]
Code
481  public function get_hittemplate_id($__type="default")
482  {
483      $ids = $this->get_hittemplate_ids($__type, true);
484      return (count($ids)==1 ? $ids[0] : null);
485  }
publicget_hittemplate_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ hitqualification_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
486  public function get_hittemplate_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
487  {
488      $hittemplate_ids = array();
489      $db = hitqualification::db();
490      $q  = " SELECT aws_hittemplate.id FROM aws_hitqualification_hittemplate INNER JOIN aws_hittemplate ON aws_hitqualification_hittemplate.hittemplate_id=aws_hittemplate.id AND aws_hitqualification_hittemplate.deleted=0 AND aws_hittemplate.deleted=0 AND aws_hitqualification_hittemplate.hitqualification_id='$this->id' " . (is_null($__type) ? "" : " AND aws_hitqualification_hittemplate.hitqualification_hittemplate_type_id='" . hitqualification_hittemplate::type_id($__type) . "'") . ($__get_primary ? " AND aws_hitqualification_hittemplate.primary=1 " : "");
491      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
492      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
493      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
494      $db->query($q);
495      while ($db->next_record())
496      {
497          $hittemplate_ids[] = $db->f("id");
498      }
499      return $hittemplate_ids;
500  }
publicget_hittemplate_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ hitqualification_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
501  public function get_hittemplate_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
502  {
503      $ids = $this->get_hittemplate_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
504      $objects = array();
505      foreach ($ids as $index=>$id)
506      {
507          $objects[$index] = new hittemplate($id);
508      }
509      return $objects;
510  }
public staticget_ids ( order , lookups , where_clause , limit , offset [0] )[ hitqualification_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
274  public static function get_ids($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
275  {
276      return hitqualification::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset);
277  }
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] )[ hitqualification_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
279  public static function get_objects($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
280  {
281      $objects = array();
282      foreach (hitqualification::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset) as $id)
283      {
284          $objects[] = new hitqualification($id);
285      }
286      return $objects;
287  }
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 ( )[ hitqualification_db ]
Parameters
No parameters for this method
Code
135  protected function insert()
136  {
137      $db = hitqualification::db();
138      $q  = " INSERT INTO aws_hitqualification ( ";
139      $q .= $db->param_string("qualificationtypeid") . ", ";
140      $q .= $db->param_string("granttime") . ", ";
141      $q .= $db->param_string("integervalue") . ", ";
142      $q .= $db->param_string("country_id") . ", ";
143      $q .= $db->param_string("hitqualificationstatus_id") . ", ";
144      $q .= $db->param_string("requiredtopreview") . ", ";
145      $q .= $db->param_string("mdate") . ", ";
146      $q .= $db->param_string("cdate") . ", ";
147      $q .= $db->param_string("deleted");
148      $q .= " ) VALUES ( ";
149      $q .= $db->value_string($this->_qualificationtypeid) . ", ";
150      $q .= $db->value_string($this->_granttime) . ", ";
151      $q .= $db->value_string($this->_integervalue) . ", ";
152      $q .= $db->value_string($this->_country_id) . ", ";
153      $q .= $db->value_string($this->_hitqualificationstatus_id) . ", ";
154      $q .= ($this->_requiredtopreview ? "'1'" : "'0'") . ", ";
155      $q .= $db->value_string(timestamp()) . ", ";
156      $q .= $db->value_string(timestamp()) . ", ";
157      $q .= $this->deleted ? "'1'" : "'0'";
158      $q .= " ) ";
159      $db->query($q);
160      $this->_id = $db->insert_id;
161      return true;
162  }
publicmap ( )[ hitqualification_db ]
Parameters
No parameters for this method
Code
103  public function map()
104  {
105      $this->_qualificationtypeid = array_key_exists("hitqualification:qualificationtypeid",$_REQUEST) ? reqval("hitqualification:qualificationtypeid") : $this->_qualificationtypeid;
106      $this->_granttime = array_key_exists("hitqualification:granttime",$_REQUEST) ? reqval("hitqualification:granttime") : $this->_granttime;
107      $this->_integervalue = array_key_exists("hitqualification:integervalue",$_REQUEST) ? reqval("hitqualification:integervalue") : $this->_integervalue;
108      $this->_country_id = array_key_exists("hitqualification:country_id",$_REQUEST) ? reqval("hitqualification:country_id") : $this->_country_id;
109      $this->_hitqualificationstatus_id = array_key_exists("hitqualification:hitqualificationstatus_id",$_REQUEST) ? reqval("hitqualification:hitqualificationstatus_id") : $this->_hitqualificationstatus_id;
110      $this->_requiredtopreview = array_key_exists("hitqualification:requiredtopreview",$_REQUEST) ? reqval("hitqualification:requiredtopreview") : $this->_requiredtopreview;
111      $this->_mdate = array_key_exists("hitqualification:mdate",$_REQUEST) ? reqval("hitqualification:mdate") : $this->_mdate;
112      $this->_cdate = array_key_exists("hitqualification:cdate",$_REQUEST) ? reqval("hitqualification:cdate") : $this->_cdate;
113      $this->_deleted = array_key_exists("hitqualification:deleted",$_REQUEST) ? reqval("hitqualification:deleted") : $this->_deleted;
114  }
publicpurge ( )[ hitqualification_db ]
Parameters
No parameters for this method
Code
203  public function purge()
204  {
205      $db = hitqualification::db();
206      $q  = " DELETE FROM aws_hitqualification ";
207      $q .= " WHERE id = " . $this->_id;
208      $db->query($q);
209      return true;
210  }
public staticsearch ( keyword )[ hitqualification_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_country ( v )[ hitqualification_db ]
Parameters
requiredv
Code
356  public function set_country($v)
357  {
358      if ($v->id > 0)
359      {
360          $this->country_id = $v->id;
361      }
362  }
publicset_hit ( v , type ["default"] )[ hitqualification_db ]
Parameters
requiredv
optionaltype ["default"]
Code
413  public function set_hit($__v, $__type="default")
414  {
415      $object = is_null(keyval($this->property_objects_array,"{$__type}_hit")) ? new hit($this->get_hit_id($__type)) : $this->property_objects_array["{$__type}_hit"];
416      if (is_null($__v))
417      {
418          $rel = new hit_hitqualification(null,$object->id,$this->id,hit_hitqualification::type_id($__type));
419          $rel->delete();
420          if (!is_null(keyval($this->property_objects_array,"{$__type}_hit")))
421          {
422              $this->property_objects_array["{$__type}_hit"] = null;
423          }
424      }
425      else
426      {
427          $id = $object->id;
428          $object = $__v;
429          $object->id = $__v->id>0 ? $__v->id : $id;
430          $object->commit();
431          $this->set_hit_ids(array($object->id),$__type);
432      }
433  }
publicset_hit_id ( v , type ["default"] )[ hitqualification_db ]
Parameters
requiredv
optionaltype ["default"]
Code
434  public function set_hit_id($__v, $__type="default")
435  {
436      $this->set_hit_ids(array($__v),$__type);
437  }
publicset_hit_ids ( v , type ["default"] )[ hitqualification_db ]
Parameters
requiredv
optionaltype ["default"]
Code
438  public function set_hit_ids($__v, $__type="default")
439  {
440      if ($this->id == 0)
441      {
442          $this->commit();
443      }
444      $type_id = hit_hitqualification::type_id($__type);
445      hit_hitqualification::delete_all(null,$this->id,$type_id);
446      if (is_array($__v))
447      {
448          foreach ($__v as $index=>$id)
449          {
450              $object = new hit_hitqualification(null,$id,$this->id,$type_id);
451              $object->deleted = false;
452              $object->hit_hitqualification_type_id = $type_id;
453              $object->commit();
454              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_hit")))
455              {
456                  $this->property_objects_array["{$__type}_hit"] = new hit($object->hit_id);
457              }
458          }
459          $this->_dirty = true;
460      }
461  }
publicset_hit_list ( v , type ["default"] )[ hitqualification_db ]
Parameters
requiredv
optionaltype ["default"]
Code
462  public function set_hit_list($__v, $__type="default")
463  {
464      if (is_array($__v))
465      {
466          $ids = array();
467          foreach ($__v as $index=>$object)
468          {
469              $ids[] = $object->id;
470          }
471          $this->set_hit_ids($ids,$__type);
472      }
473  }
publicset_hitqualificationstatus ( v )[ hitqualification_db ]
Parameters
requiredv
Code
368  public function set_hitqualificationstatus($v)
369  {
370      if ($v->id > 0)
371      {
372          $this->hitqualificationstatus_id = $v->id;
373      }
374  }
publicset_hittemplate ( v , type ["default"] )[ hitqualification_db ]
Parameters
requiredv
optionaltype ["default"]
Code
512  public function set_hittemplate($__v, $__type="default")
513  {
514      $object = is_null(keyval($this->property_objects_array,"{$__type}_hittemplate")) ? new hittemplate($this->get_hittemplate_id($__type)) : $this->property_objects_array["{$__type}_hittemplate"];
515      if (is_null($__v))
516      {
517          $rel = new hitqualification_hittemplate(null,$this->id,$object->id,hitqualification_hittemplate::type_id($__type));
518          $rel->delete();
519          if (!is_null(keyval($this->property_objects_array,"{$__type}_hittemplate")))
520          {
521              $this->property_objects_array["{$__type}_hittemplate"] = null;
522          }
523      }
524      else
525      {
526          $id = $object->id;
527          $object = $__v;
528          $object->id = $__v->id>0 ? $__v->id : $id;
529          $object->commit();
530          $this->set_hittemplate_ids(array($object->id),$__type);
531      }
532  }
publicset_hittemplate_id ( v , type ["default"] )[ hitqualification_db ]
Parameters
requiredv
optionaltype ["default"]
Code
533  public function set_hittemplate_id($__v, $__type="default")
534  {
535      $this->set_hittemplate_ids(array($__v),$__type);
536  }
publicset_hittemplate_ids ( v , type ["default"] )[ hitqualification_db ]
Parameters
requiredv
optionaltype ["default"]
Code
537  public function set_hittemplate_ids($__v, $__type="default")
538  {
539      if ($this->id == 0)
540      {
541          $this->commit();
542      }
543      $type_id = hitqualification_hittemplate::type_id($__type);
544      hitqualification_hittemplate::delete_all($this->id,null,$type_id);
545      if (is_array($__v))
546      {
547          foreach ($__v as $index=>$id)
548          {
549              $object = new hitqualification_hittemplate(null,$this->id,$id,$type_id);
550              $object->deleted = false;
551              $object->hitqualification_hittemplate_type_id = $type_id;
552              $object->commit();
553              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_hittemplate")))
554              {
555                  $this->property_objects_array["{$__type}_hittemplate"] = new hittemplate($object->hittemplate_id);
556              }
557          }
558          $this->_dirty = true;
559      }
560  }
publicset_hittemplate_list ( v , type ["default"] )[ hitqualification_db ]
Parameters
requiredv
optionaltype ["default"]
Code
561  public function set_hittemplate_list($__v, $__type="default")
562  {
563      if (is_array($__v))
564      {
565          $ids = array();
566          foreach ($__v as $index=>$object)
567          {
568              $ids[] = $object->id;
569          }
570          $this->set_hittemplate_ids($ids,$__type);
571      }
572  }
public__toString ( )[ hitqualification_db ]
Parameters
No parameters for this method
Code
347  public function __toString()
348  {
349      return (is_null($this->id) ? "" : $this->id);
350  }
publicundelete ( )[ hitqualification_db ]
Parameters
No parameters for this method
Code
192  public function undelete()
193  {
194      $db = hitqualification::db();
195      $q  = " UPDATE aws_hitqualification SET ";
196      $q .= " deleted = 0 ";
197      $q .= " WHERE id = " . $this->_id;
198      $db->query($q);
199      $this->deleted = false;
200      return true;
201  }
protectedupdate ( )[ hitqualification_db ]
Parameters
No parameters for this method
Code
164  protected function update()
165  {
166      $db = hitqualification::db();
167      $q  = " UPDATE aws_hitqualification SET ";
168      $q .= $db->param_string("qualificationtypeid") . " = " . $db->value_string($this->_qualificationtypeid) . ", ";
169      $q .= $db->param_string("granttime") . " = " . $db->value_string($this->_granttime) . ", ";
170      $q .= $db->param_string("integervalue") . " = " . $db->value_string($this->_integervalue) . ", ";
171      $q .= $db->param_string("country_id") . " = " . $db->value_string($this->_country_id) . ", ";
172      $q .= $db->param_string("hitqualificationstatus_id") . " = " . $db->value_string($this->_hitqualificationstatus_id) . ", ";
173      $q .= $db->param_string("requiredtopreview") . " = " . ($this->_requiredtopreview ? "'1'" : "'0'") . ", ";
174      $q .= $db->param_string("mdate") . " = " . $db->value_string(timestamp()) . ", ";
175      $q .= $db->param_string("deleted") . " = " . ($this->deleted ? "'1'" : "'0'");
176      $q .= " WHERE id = " . $this->_id;
177      $db->query($q);
178      return true;
179  }
 
Accessors
publicarray[ obj ]
Code
096  public function get_array()
097  {
098      return get_object_vars($this);
099  }
publicclassname[ obj ]
Code
086  public function get_classname()
087  {
088      return get_class($this);
089  }
publiccolumns[ hitqualification_db ]
Code
212  public static function get_columns($__columns, $__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
213  {
214      $lookups = is_array($__lookups) ? $__lookups : array($__lookups);
215      $colarray = is_array($__columns) ? $__columns : explode(",",$__columns);
216      $colstring = is_array($__columns) ? implode(",",$__columns) : $__columns;
217 
218      $db = hitqualification::db();
219      $data = array();
220      $q  = " SELECT $colstring ";
221      $q .= " FROM aws_hitqualification ";
222      $q .= " WHERE aws_hitqualification.deleted = 0 ";
223      $q .= is_null($__where_clause) ? null : " AND ($__where_clause) ";
224      $q .= array_key_exists("country_id",$lookups) ? " AND aws_hitqualification.country_id='" . $lookups["country_id"] . "' " : "";
225      $q .= array_key_exists("hitqualificationstatus_id",$lookups) ? " AND aws_hitqualification.hitqualificationstatus_id='" . $lookups["hitqualificationstatus_id"] . "' " : "";
226 
227      if (is_string($__order))
228      {
229          $q .= "ORDER BY " . $__order;
230      }
231      else if (is_array($__order) and count($__order)>0)
232      {
233          $orderings = array();
234          foreach ($__order as $col=>$dir)
235          {
236              $orderings[] = " $col $dir ";
237          }
238          $q .= "ORDER BY " . implode(", ", $orderings);
239      }
240      else if (is_object($__order))
241      {
242          $q .= "";
243      }
244      else
245      {
246          // THERE IS NO `order` COLUMN ON THIS OBJECT
247      }
248 
249      if (!is_null($__limit))
250      {
251          $q .= " LIMIT $__offset , $__limit ";
252      }
253 
254      $db->query($q);
255 
256      if (count($colarray)>1 || $colstring=="*")
257      {
258          while ($db->next_record())
259          {
260              $data[] = $db->record;
261          }
262      }
263      else
264      {
265          while ($db->next_record())
266          {
267              $data[] = $db->f(0);
268          }
269      }
270 
271      return $data;
272  }
publiccountry[ hitqualification_db ]
Code
352  public function get_country()
353  {
354      return new country($this->country_id);
355  }
Code
356  public function set_country($v)
357  {
358      if ($v->id > 0)
359      {
360          $this->country_id = $v->id;
361      }
362  }
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  }
publichit[ hitqualification_db ]
Code
376  public function get_hit($__type="default")
377  {
378      $object = is_null(keyval($this->property_objects_array,"{$__type}_hit")) ? new hit($this->get_hit_id($__type)) : $this->property_objects_array["{$__type}_hit"];
379      $this->property_objects_array["{$__type}_hit"] = $object;
380      return $object;
381  }
Code
413  public function set_hit($__v, $__type="default")
414  {
415      $object = is_null(keyval($this->property_objects_array,"{$__type}_hit")) ? new hit($this->get_hit_id($__type)) : $this->property_objects_array["{$__type}_hit"];
416      if (is_null($__v))
417      {
418          $rel = new hit_hitqualification(null,$object->id,$this->id,hit_hitqualification::type_id($__type));
419          $rel->delete();
420          if (!is_null(keyval($this->property_objects_array,"{$__type}_hit")))
421          {
422              $this->property_objects_array["{$__type}_hit"] = null;
423          }
424      }
425      else
426      {
427          $id = $object->id;
428          $object = $__v;
429          $object->id = $__v->id>0 ? $__v->id : $id;
430          $object->commit();
431          $this->set_hit_ids(array($object->id),$__type);
432      }
433  }
publichit_id[ hitqualification_db ]
Code
382  public function get_hit_id($__type="default")
383  {
384      $ids = $this->get_hit_ids($__type, true);
385      return (count($ids)==1 ? $ids[0] : null);
386  }
Code
434  public function set_hit_id($__v, $__type="default")
435  {
436      $this->set_hit_ids(array($__v),$__type);
437  }
publichit_ids[ hitqualification_db ]
Code
387  public function get_hit_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
388  {
389      $hit_ids = array();
390      $db = hitqualification::db();
391      $q  = " SELECT aws_hit.id FROM aws_hit_hitqualification INNER JOIN aws_hit ON aws_hit_hitqualification.hit_id=aws_hit.id AND aws_hit_hitqualification.deleted=0 AND aws_hit.deleted=0 AND aws_hit_hitqualification.hitqualification_id='$this->id' " . (is_null($__type) ? "" : " AND aws_hit_hitqualification.hit_hitqualification_type_id='" . hit_hitqualification::type_id($__type) . "'") . ($__get_primary ? " AND aws_hit_hitqualification.primary=1 " : "");
392      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
393      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
394      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
395      $db->query($q);
396      while ($db->next_record())
397      {
398          $hit_ids[] = $db->f("id");
399      }
400      return $hit_ids;
401  }
Code
438  public function set_hit_ids($__v, $__type="default")
439  {
440      if ($this->id == 0)
441      {
442          $this->commit();
443      }
444      $type_id = hit_hitqualification::type_id($__type);
445      hit_hitqualification::delete_all(null,$this->id,$type_id);
446      if (is_array($__v))
447      {
448          foreach ($__v as $index=>$id)
449          {
450              $object = new hit_hitqualification(null,$id,$this->id,$type_id);
451              $object->deleted = false;
452              $object->hit_hitqualification_type_id = $type_id;
453              $object->commit();
454              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_hit")))
455              {
456                  $this->property_objects_array["{$__type}_hit"] = new hit($object->hit_id);
457              }
458          }
459          $this->_dirty = true;
460      }
461  }
publichit_list[ hitqualification_db ]
Code
402  public function get_hit_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
403  {
404      $ids = $this->get_hit_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
405      $objects = array();
406      foreach ($ids as $index=>$id)
407      {
408          $objects[$index] = new hit($id);
409      }
410      return $objects;
411  }
Code
462  public function set_hit_list($__v, $__type="default")
463  {
464      if (is_array($__v))
465      {
466          $ids = array();
467          foreach ($__v as $index=>$object)
468          {
469              $ids[] = $object->id;
470          }
471          $this->set_hit_ids($ids,$__type);
472      }
473  }
publichitqualificationstatus[ hitqualification_db ]
Code
364  public function get_hitqualificationstatus()
365  {
366      return new hitqualificationstatus($this->hitqualificationstatus_id);
367  }
Code
368  public function set_hitqualificationstatus($v)
369  {
370      if ($v->id > 0)
371      {
372          $this->hitqualificationstatus_id = $v->id;
373      }
374  }
publichittemplate[ hitqualification_db ]
Code
475  public function get_hittemplate($__type="default")
476  {
477      $object = is_null(keyval($this->property_objects_array,"{$__type}_hittemplate")) ? new hittemplate($this->get_hittemplate_id($__type)) : $this->property_objects_array["{$__type}_hittemplate"];
478      $this->property_objects_array["{$__type}_hittemplate"] = $object;
479      return $object;
480  }
Code
512  public function set_hittemplate($__v, $__type="default")
513  {
514      $object = is_null(keyval($this->property_objects_array,"{$__type}_hittemplate")) ? new hittemplate($this->get_hittemplate_id($__type)) : $this->property_objects_array["{$__type}_hittemplate"];
515      if (is_null($__v))
516      {
517          $rel = new hitqualification_hittemplate(null,$this->id,$object->id,hitqualification_hittemplate::type_id($__type));
518          $rel->delete();
519          if (!is_null(keyval($this->property_objects_array,"{$__type}_hittemplate")))
520          {
521              $this->property_objects_array["{$__type}_hittemplate"] = null;
522          }
523      }
524      else
525      {
526          $id = $object->id;
527          $object = $__v;
528          $object->id = $__v->id>0 ? $__v->id : $id;
529          $object->commit();
530          $this->set_hittemplate_ids(array($object->id),$__type);
531      }
532  }
publichittemplate_id[ hitqualification_db ]
Code
481  public function get_hittemplate_id($__type="default")
482  {
483      $ids = $this->get_hittemplate_ids($__type, true);
484      return (count($ids)==1 ? $ids[0] : null);
485  }
Code
533  public function set_hittemplate_id($__v, $__type="default")
534  {
535      $this->set_hittemplate_ids(array($__v),$__type);
536  }
publichittemplate_ids[ hitqualification_db ]
Code
486  public function get_hittemplate_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
487  {
488      $hittemplate_ids = array();
489      $db = hitqualification::db();
490      $q  = " SELECT aws_hittemplate.id FROM aws_hitqualification_hittemplate INNER JOIN aws_hittemplate ON aws_hitqualification_hittemplate.hittemplate_id=aws_hittemplate.id AND aws_hitqualification_hittemplate.deleted=0 AND aws_hittemplate.deleted=0 AND aws_hitqualification_hittemplate.hitqualification_id='$this->id' " . (is_null($__type) ? "" : " AND aws_hitqualification_hittemplate.hitqualification_hittemplate_type_id='" . hitqualification_hittemplate::type_id($__type) . "'") . ($__get_primary ? " AND aws_hitqualification_hittemplate.primary=1 " : "");
491      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
492      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
493      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
494      $db->query($q);
495      while ($db->next_record())
496      {
497          $hittemplate_ids[] = $db->f("id");
498      }
499      return $hittemplate_ids;
500  }
Code
537  public function set_hittemplate_ids($__v, $__type="default")
538  {
539      if ($this->id == 0)
540      {
541          $this->commit();
542      }
543      $type_id = hitqualification_hittemplate::type_id($__type);
544      hitqualification_hittemplate::delete_all($this->id,null,$type_id);
545      if (is_array($__v))
546      {
547          foreach ($__v as $index=>$id)
548          {
549              $object = new hitqualification_hittemplate(null,$this->id,$id,$type_id);
550              $object->deleted = false;
551              $object->hitqualification_hittemplate_type_id = $type_id;
552              $object->commit();
553              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_hittemplate")))
554              {
555                  $this->property_objects_array["{$__type}_hittemplate"] = new hittemplate($object->hittemplate_id);
556              }
557          }
558          $this->_dirty = true;
559      }
560  }
publichittemplate_list[ hitqualification_db ]
Code
501  public function get_hittemplate_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
502  {
503      $ids = $this->get_hittemplate_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
504      $objects = array();
505      foreach ($ids as $index=>$id)
506      {
507          $objects[$index] = new hittemplate($id);
508      }
509      return $objects;
510  }
Code
561  public function set_hittemplate_list($__v, $__type="default")
562  {
563      if (is_array($__v))
564      {
565          $ids = array();
566          foreach ($__v as $index=>$object)
567          {
568              $ids[] = $object->id;
569          }
570          $this->set_hittemplate_ids($ids,$__type);
571      }
572  }
publicids[ hitqualification_db ]
Code
274  public static function get_ids($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
275  {
276      return hitqualification::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset);
277  }
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[ hitqualification_db ]
Code
279  public static function get_objects($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
280  {
281      $objects = array();
282      foreach (hitqualification::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset) as $id)
283      {
284          $objects[] = new hitqualification($id);
285      }
286      return $objects;
287  }
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