Helix Installation   Getting Started   Reference Documentation   Global Functions   Quick Start
ModulesClassesFunctions
 

Class Reference

class hittemplate extends hittemplate_ext

Hide Inherited MembersAmazon Web Services
Description
No description.
 
Constants
constantTABLENAME ["aws_hittemplate"][ hittemplate ]
 
Properties
protected_autoapprovaldelayinseconds[ hittemplate_db ]
protected_autoapprovaldelayinseconds_dirty[ hittemplate_db ]
protected_cdate[ hittemplate_db ]
protected_cdate_dirty[ hittemplate_db ]
protected_deleted[ hittemplate_db ]
protected_deleted_dirty[ hittemplate_db ]
protected_description[ hittemplate_db ]
protected_description_dirty[ hittemplate_db ]
protected_dirty[ obj ]
protected_hittemplateid[ hittemplate_db ]
protected_hittemplateid_dirty[ hittemplate_db ]
protected_id[ hittemplate_db ]
protected_id_dirty[ hittemplate_db ]
protected_keywords[ hittemplate_db ]
protected_keywords_dirty[ hittemplate_db ]
protected_lifetimeinseconds[ hittemplate_db ]
protected_lifetimeinseconds_dirty[ hittemplate_db ]
protected_maxassignments[ hittemplate_db ]
protected_maxassignments_dirty[ hittemplate_db ]
protected_mdate[ hittemplate_db ]
protected_mdate_dirty[ hittemplate_db ]
protected_name[ hittemplate_db ]
protected_name_dirty[ hittemplate_db ]
publicproperty_objects_array[ obj ]
protected_question[ hittemplate_db ]
protected_question_dirty[ hittemplate_db ]
protected_requesterannotation[ hittemplate_db ]
protected_requesterannotation_dirty[ hittemplate_db ]
protected_title[ hittemplate_db ]
protected_title_dirty[ hittemplate_db ]
 
Methods
publiccommit ( )[ hittemplate_db ]
Parameters
No parameters for this method
Code
144  public function commit()
145  {
146      if ($this->_id > 0)
147      {
148          $this->update();
149      }
150      else
151      {
152          $this->insert();
153      }
154 
155      foreach ($this->property_objects_array as $property=>$object)
156      {
157          $this->{$property} = $object;
158      }
159 
160      return true;
161  }
public__construct ( id , hittemplateid )[ hittemplate_db ]
Parameters
optionalid
optionalhittemplateid
Code
058  public function __construct($__id=null, $__hittemplateid=null)
059  {
060      $this->_id = 0;
061      $this->_hittemplateid = $__hittemplateid;
062      $this->_name = "";
063      $this->_description = "";
064      $this->_title = "";
065      $this->_keywords = "";
066      $this->_question = "";
067      $this->_lifetimeinseconds = 0;
068      $this->_autoapprovaldelayinseconds = 0;
069      $this->_requesterannotation = "";
070      $this->_maxassignments = 0;
071      $this->_mdate = null;
072      $this->_cdate = null;
073      $this->_deleted = false;
074 
075      $this->_id_dirty = false;
076      $this->_hittemplateid_dirty = false;
077      $this->_name_dirty = false;
078      $this->_description_dirty = false;
079      $this->_title_dirty = false;
080      $this->_keywords_dirty = false;
081      $this->_question_dirty = false;
082      $this->_lifetimeinseconds_dirty = false;
083      $this->_autoapprovaldelayinseconds_dirty = false;
084      $this->_requesterannotation_dirty = false;
085      $this->_maxassignments_dirty = false;
086      $this->_mdate_dirty = false;
087      $this->_cdate_dirty = false;
088      $this->_deleted_dirty = false;
089 
090      if (is_null($__id) && is_null($__hittemplateid))
091      {
092          return;
093      }
094 
095      $db = hittemplate::db();
096      $q  = " SELECT aws_hittemplate.id,aws_hittemplate.hittemplateid,aws_hittemplate.name,aws_hittemplate.description,aws_hittemplate.title,aws_hittemplate.keywords,aws_hittemplate.question,aws_hittemplate.lifetimeinseconds,aws_hittemplate.autoapprovaldelayinseconds,aws_hittemplate.requesterannotation,aws_hittemplate.maxassignments,aws_hittemplate.mdate,aws_hittemplate.cdate,aws_hittemplate.deleted ";
097      $q .= " FROM aws_hittemplate ";       
098      if (!is_null($__id))
099      {
100          $q .= " WHERE id = '$__id' ";
101      }
102      else if (!is_null($__hittemplateid))
103      {
104          $q .= " WHERE hittemplateid = '$__hittemplateid' ";
105      }
106 
107      $db->query($q);
108      if ($db->next_record() && $db->num_rows() == 1)
109      {
110          $this->_id = $db->f("id");
111          $this->_hittemplateid = $db->f("hittemplateid");
112          $this->_name = $db->f("name");
113          $this->_description = $db->f("description");
114          $this->_title = $db->f("title");
115          $this->_keywords = $db->f("keywords");
116          $this->_question = $db->f("question");
117          $this->_lifetimeinseconds = $db->f("lifetimeinseconds");
118          $this->_autoapprovaldelayinseconds = $db->f("autoapprovaldelayinseconds");
119          $this->_requesterannotation = $db->f("requesterannotation");
120          $this->_maxassignments = $db->f("maxassignments");
121          $this->_mdate = $db->f("mdate");
122          $this->_cdate = $db->f("cdate");
123          $this->_deleted = $db->f("deleted");
124      }
125  }
protected staticdb ( )[ hittemplate_db ]
Parameters
No parameters for this method
Code
687  protected static function db()
688  {
689      return new db();
690  }
publicdelete ( )[ hittemplate_db ]
Parameters
No parameters for this method
Code
221  public function delete()
222  {
223      $db = hittemplate::db();
224      $q  = " UPDATE aws_hittemplate SET ";
225      $q .= " deleted = 1 ";
226      $q .= " WHERE id = " . $this->_id;
227      $db->query($q);
228      $this->deleted = true;
229      return true;
230  }
public staticdelete_all ( )[ hittemplate_db ]
Parameters
No parameters for this method
Code
327  public static function delete_all()
328  {
329      $db = hittemplate::db();
330      $q  = " UPDATE aws_hittemplate SET ";
331      $q .= " deleted = 1 ";
332     
333      $db->query($q);
334      return true;
335  }
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] )[ hittemplate_db ]
Parameters
requiredcolumns
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
252  public static function get_columns($__columns, $__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
253  {
254      $lookups = is_array($__lookups) ? $__lookups : array($__lookups);
255      $colarray = is_array($__columns) ? $__columns : explode(",",$__columns);
256      $colstring = is_array($__columns) ? implode(",",$__columns) : $__columns;
257 
258      $db = hittemplate::db();
259      $data = array();
260      $q  = " SELECT $colstring ";
261      $q .= " FROM aws_hittemplate ";
262      $q .= " WHERE aws_hittemplate.deleted = 0 ";
263      $q .= is_null($__where_clause) ? null : " AND ($__where_clause) ";
264 
265      if (is_string($__order))
266      {
267          $q .= "ORDER BY " . $__order;
268      }
269      else if (is_array($__order) and count($__order)>0)
270      {
271          $orderings = array();
272          foreach ($__order as $col=>$dir)
273          {
274              $orderings[] = " $col $dir ";
275          }
276          $q .= "ORDER BY " . implode(", ", $orderings);
277      }
278      else if (is_object($__order))
279      {
280          $q .= "";
281      }
282      else
283      {
284          // THERE IS NO `order` COLUMN ON THIS OBJECT
285      }
286 
287      if (!is_null($__limit))
288      {
289          $q .= " LIMIT $__offset , $__limit ";
290      }
291 
292      $db->query($q);
293 
294      if (count($colarray)>1 || $colstring=="*")
295      {
296          while ($db->next_record())
297          {
298              $data[] = $db->record;
299          }
300      }
301      else
302      {
303          while ($db->next_record())
304          {
305              $data[] = $db->f(0);
306          }
307      }
308 
309      return $data;
310  }
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"] )[ hittemplate_db ]
Parameters
optionaltype ["default"]
Code
489  public function get_hit($__type="default")
490  {
491      $object = is_null(keyval($this->property_objects_array,"{$__type}_hit")) ? new hit($this->get_hit_id($__type)) : $this->property_objects_array["{$__type}_hit"];
492      $this->property_objects_array["{$__type}_hit"] = $object;
493      return $object;
494  }
publicget_hit_id ( type ["default"] )[ hittemplate_db ]
Parameters
optionaltype ["default"]
Code
495  public function get_hit_id($__type="default")
496  {
497      $ids = $this->get_hit_ids($__type, true);
498      return (count($ids)==1 ? $ids[0] : null);
499  }
publicget_hit_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ hittemplate_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
500  public function get_hit_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
501  {
502      $hit_ids = array();
503      $db = hittemplate::db();
504      $q  = " SELECT aws_hit.id FROM aws_hit_hittemplate INNER JOIN aws_hit ON aws_hit_hittemplate.hit_id=aws_hit.id AND aws_hit_hittemplate.deleted=0 AND aws_hit.deleted=0 AND aws_hit_hittemplate.hittemplate_id='$this->id' " . (is_null($__type) ? "" : " AND aws_hit_hittemplate.hit_hittemplate_type_id='" . hit_hittemplate::type_id($__type) . "'") . ($__get_primary ? " AND aws_hit_hittemplate.primary=1 " : "");
505      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
506      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
507      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
508      $db->query($q);
509      while ($db->next_record())
510      {
511          $hit_ids[] = $db->f("id");
512      }
513      return $hit_ids;
514  }
publicget_hit_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ hittemplate_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
515  public function get_hit_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
516  {
517      $ids = $this->get_hit_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
518      $objects = array();
519      foreach ($ids as $index=>$id)
520      {
521          $objects[$index] = new hit($id);
522      }
523      return $objects;
524  }
publicget_hitqualification ( type ["default"] )[ hittemplate_db ]
Parameters
optionaltype ["default"]
Code
588  public function get_hitqualification($__type="default")
589  {
590      $object = is_null(keyval($this->property_objects_array,"{$__type}_hitqualification")) ? new hitqualification($this->get_hitqualification_id($__type)) : $this->property_objects_array["{$__type}_hitqualification"];
591      $this->property_objects_array["{$__type}_hitqualification"] = $object;
592      return $object;
593  }
publicget_hitqualification_id ( type ["default"] )[ hittemplate_db ]
Parameters
optionaltype ["default"]
Code
594  public function get_hitqualification_id($__type="default")
595  {
596      $ids = $this->get_hitqualification_ids($__type, true);
597      return (count($ids)==1 ? $ids[0] : null);
598  }
publicget_hitqualification_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ hittemplate_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
599  public function get_hitqualification_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
600  {
601      $hitqualification_ids = array();
602      $db = hittemplate::db();
603      $q  = " SELECT aws_hitqualification.id FROM aws_hitqualification_hittemplate INNER JOIN aws_hitqualification ON aws_hitqualification_hittemplate.hitqualification_id=aws_hitqualification.id AND aws_hitqualification_hittemplate.deleted=0 AND aws_hitqualification.deleted=0 AND aws_hitqualification_hittemplate.hittemplate_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 " : "");
604      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
605      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
606      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
607      $db->query($q);
608      while ($db->next_record())
609      {
610          $hitqualification_ids[] = $db->f("id");
611      }
612      return $hitqualification_ids;
613  }
publicget_hitqualification_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ hittemplate_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
614  public function get_hitqualification_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
615  {
616      $ids = $this->get_hitqualification_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
617      $objects = array();
618      foreach ($ids as $index=>$id)
619      {
620          $objects[$index] = new hitqualification($id);
621      }
622      return $objects;
623  }
publicget_hitreward ( type ["default"] )[ hittemplate_db ]
Parameters
optionaltype ["default"]
Code
390  public function get_hitreward($__type="default")
391  {
392      $object = is_null(keyval($this->property_objects_array,"{$__type}_hitreward")) ? new hitreward($this->get_hitreward_id($__type)) : $this->property_objects_array["{$__type}_hitreward"];
393      $this->property_objects_array["{$__type}_hitreward"] = $object;
394      return $object;
395  }
publicget_hitreward_id ( type ["default"] )[ hittemplate_db ]
Parameters
optionaltype ["default"]
Code
396  public function get_hitreward_id($__type="default")
397  {
398      $ids = $this->get_hitreward_ids($__type, true);
399      return (count($ids)==1 ? $ids[0] : null);
400  }
publicget_hitreward_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ hittemplate_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
401  public function get_hitreward_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
402  {
403      $hitreward_ids = array();
404      $db = hittemplate::db();
405      $q  = " SELECT aws_hitreward.id FROM aws_hitreward_hittemplate INNER JOIN aws_hitreward ON aws_hitreward_hittemplate.hitreward_id=aws_hitreward.id AND aws_hitreward_hittemplate.deleted=0 AND aws_hitreward.deleted=0 AND aws_hitreward_hittemplate.hittemplate_id='$this->id' " . (is_null($__type) ? "" : " AND aws_hitreward_hittemplate.hitreward_hittemplate_type_id='" . hitreward_hittemplate::type_id($__type) . "'") . ($__get_primary ? " AND aws_hitreward_hittemplate.primary=1 " : "");
406      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
407      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
408      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
409      $db->query($q);
410      while ($db->next_record())
411      {
412          $hitreward_ids[] = $db->f("id");
413      }
414      return $hitreward_ids;
415  }
publicget_hitreward_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ hittemplate_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
416  public function get_hitreward_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
417  {
418      $ids = $this->get_hitreward_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
419      $objects = array();
420      foreach ($ids as $index=>$id)
421      {
422          $objects[$index] = new hitreward($id);
423      }
424      return $objects;
425  }
public staticget_ids ( order , lookups , where_clause , limit , offset [0] )[ hittemplate_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
312  public static function get_ids($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
313  {
314      return hittemplate::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset);
315  }
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] )[ hittemplate_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
317  public static function get_objects($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
318  {
319      $objects = array();
320      foreach (hittemplate::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset) as $id)
321      {
322          $objects[] = new hittemplate($id);
323      }
324      return $objects;
325  }
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 ( )[ hittemplate_db ]
Parameters
No parameters for this method
Code
163  protected function insert()
164  {
165      $db = hittemplate::db();
166      $q  = " INSERT INTO aws_hittemplate ( ";
167      $q .= $db->param_string("hittemplateid") . ", ";
168      $q .= $db->param_string("name") . ", ";
169      $q .= $db->param_string("description") . ", ";
170      $q .= $db->param_string("title") . ", ";
171      $q .= $db->param_string("keywords") . ", ";
172      $q .= $db->param_string("question") . ", ";
173      $q .= $db->param_string("lifetimeinseconds") . ", ";
174      $q .= $db->param_string("autoapprovaldelayinseconds") . ", ";
175      $q .= $db->param_string("requesterannotation") . ", ";
176      $q .= $db->param_string("maxassignments") . ", ";
177      $q .= $db->param_string("mdate") . ", ";
178      $q .= $db->param_string("cdate") . ", ";
179      $q .= $db->param_string("deleted");
180      $q .= " ) VALUES ( ";
181      $q .= $db->value_string($this->_hittemplateid) . ", ";
182      $q .= $db->value_string($this->_name) . ", ";
183      $q .= $db->value_string($this->_description) . ", ";
184      $q .= $db->value_string($this->_title) . ", ";
185      $q .= $db->value_string($this->_keywords) . ", ";
186      $q .= $db->value_string($this->_question) . ", ";
187      $q .= $db->value_string($this->_lifetimeinseconds) . ", ";
188      $q .= $db->value_string($this->_autoapprovaldelayinseconds) . ", ";
189      $q .= $db->value_string($this->_requesterannotation) . ", ";
190      $q .= $db->value_string($this->_maxassignments) . ", ";
191      $q .= $db->value_string(timestamp()) . ", ";
192      $q .= $db->value_string(timestamp()) . ", ";
193      $q .= $this->deleted ? "'1'" : "'0'";
194      $q .= " ) ";
195      $db->query($q);
196      $this->_id = $db->insert_id;
197      return true;
198  }
publicmap ( )[ hittemplate_db ]
Parameters
No parameters for this method
Code
127  public function map()
128  {
129      $this->_hittemplateid = array_key_exists("hittemplate:hittemplateid",$_REQUEST) ? reqval("hittemplate:hittemplateid") : $this->_hittemplateid;
130      $this->_name = array_key_exists("hittemplate:name",$_REQUEST) ? reqval("hittemplate:name") : $this->_name;
131      $this->_description = array_key_exists("hittemplate:description",$_REQUEST) ? reqval("hittemplate:description") : $this->_description;
132      $this->_title = array_key_exists("hittemplate:title",$_REQUEST) ? reqval("hittemplate:title") : $this->_title;
133      $this->_keywords = array_key_exists("hittemplate:keywords",$_REQUEST) ? reqval("hittemplate:keywords") : $this->_keywords;
134      $this->_question = array_key_exists("hittemplate:question",$_REQUEST) ? reqval("hittemplate:question") : $this->_question;
135      $this->_lifetimeinseconds = array_key_exists("hittemplate:lifetimeinseconds",$_REQUEST) ? reqval("hittemplate:lifetimeinseconds") : $this->_lifetimeinseconds;
136      $this->_autoapprovaldelayinseconds = array_key_exists("hittemplate:autoapprovaldelayinseconds",$_REQUEST) ? reqval("hittemplate:autoapprovaldelayinseconds") : $this->_autoapprovaldelayinseconds;
137      $this->_requesterannotation = array_key_exists("hittemplate:requesterannotation",$_REQUEST) ? reqval("hittemplate:requesterannotation") : $this->_requesterannotation;
138      $this->_maxassignments = array_key_exists("hittemplate:maxassignments",$_REQUEST) ? reqval("hittemplate:maxassignments") : $this->_maxassignments;
139      $this->_mdate = array_key_exists("hittemplate:mdate",$_REQUEST) ? reqval("hittemplate:mdate") : $this->_mdate;
140      $this->_cdate = array_key_exists("hittemplate:cdate",$_REQUEST) ? reqval("hittemplate:cdate") : $this->_cdate;
141      $this->_deleted = array_key_exists("hittemplate:deleted",$_REQUEST) ? reqval("hittemplate:deleted") : $this->_deleted;
142  }
publicpurge ( )[ hittemplate_db ]
Parameters
No parameters for this method
Code
243  public function purge()
244  {
245      $db = hittemplate::db();
246      $q  = " DELETE FROM aws_hittemplate ";
247      $q .= " WHERE id = " . $this->_id;
248      $db->query($q);
249      return true;
250  }
public staticsearch ( keyword )[ hittemplate_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_hit ( v , type ["default"] )[ hittemplate_db ]
Parameters
requiredv
optionaltype ["default"]
Code
526  public function set_hit($__v, $__type="default")
527  {
528      $object = is_null(keyval($this->property_objects_array,"{$__type}_hit")) ? new hit($this->get_hit_id($__type)) : $this->property_objects_array["{$__type}_hit"];
529      if (is_null($__v))
530      {
531          $rel = new hit_hittemplate(null,$object->id,$this->id,hit_hittemplate::type_id($__type));
532          $rel->delete();
533          if (!is_null(keyval($this->property_objects_array,"{$__type}_hit")))
534          {
535              $this->property_objects_array["{$__type}_hit"] = null;
536          }
537      }
538      else
539      {
540          $id = $object->id;
541          $object = $__v;
542          $object->id = $__v->id>0 ? $__v->id : $id;
543          $object->commit();
544          $this->set_hit_ids(array($object->id),$__type);
545      }
546  }
publicset_hit_id ( v , type ["default"] )[ hittemplate_db ]
Parameters
requiredv
optionaltype ["default"]
Code
547  public function set_hit_id($__v, $__type="default")
548  {
549      $this->set_hit_ids(array($__v),$__type);
550  }
publicset_hit_ids ( v , type ["default"] )[ hittemplate_db ]
Parameters
requiredv
optionaltype ["default"]
Code
551  public function set_hit_ids($__v, $__type="default")
552  {
553      if ($this->id == 0)
554      {
555          $this->commit();
556      }
557      $type_id = hit_hittemplate::type_id($__type);
558      hit_hittemplate::delete_all(null,$this->id,$type_id);
559      if (is_array($__v))
560      {
561          foreach ($__v as $index=>$id)
562          {
563              $object = new hit_hittemplate(null,$id,$this->id,$type_id);
564              $object->deleted = false;
565              $object->hit_hittemplate_type_id = $type_id;
566              $object->commit();
567              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_hit")))
568              {
569                  $this->property_objects_array["{$__type}_hit"] = new hit($object->hit_id);
570              }
571          }
572          $this->_dirty = true;
573      }
574  }
publicset_hit_list ( v , type ["default"] )[ hittemplate_db ]
Parameters
requiredv
optionaltype ["default"]
Code
575  public function set_hit_list($__v, $__type="default")
576  {
577      if (is_array($__v))
578      {
579          $ids = array();
580          foreach ($__v as $index=>$object)
581          {
582              $ids[] = $object->id;
583          }
584          $this->set_hit_ids($ids,$__type);
585      }
586  }
publicset_hitqualification ( v , type ["default"] )[ hittemplate_db ]
Parameters
requiredv
optionaltype ["default"]
Code
625  public function set_hitqualification($__v, $__type="default")
626  {
627      $object = is_null(keyval($this->property_objects_array,"{$__type}_hitqualification")) ? new hitqualification($this->get_hitqualification_id($__type)) : $this->property_objects_array["{$__type}_hitqualification"];
628      if (is_null($__v))
629      {
630          $rel = new hitqualification_hittemplate(null,$object->id,$this->id,hitqualification_hittemplate::type_id($__type));
631          $rel->delete();
632          if (!is_null(keyval($this->property_objects_array,"{$__type}_hitqualification")))
633          {
634              $this->property_objects_array["{$__type}_hitqualification"] = null;
635          }
636      }
637      else
638      {
639          $id = $object->id;
640          $object = $__v;
641          $object->id = $__v->id>0 ? $__v->id : $id;
642          $object->commit();
643          $this->set_hitqualification_ids(array($object->id),$__type);
644      }
645  }
publicset_hitqualification_id ( v , type ["default"] )[ hittemplate_db ]
Parameters
requiredv
optionaltype ["default"]
Code
646  public function set_hitqualification_id($__v, $__type="default")
647  {
648      $this->set_hitqualification_ids(array($__v),$__type);
649  }
publicset_hitqualification_ids ( v , type ["default"] )[ hittemplate_db ]
Parameters
requiredv
optionaltype ["default"]
Code
650  public function set_hitqualification_ids($__v, $__type="default")
651  {
652      if ($this->id == 0)
653      {
654          $this->commit();
655      }
656      $type_id = hitqualification_hittemplate::type_id($__type);
657      hitqualification_hittemplate::delete_all(null,$this->id,$type_id);
658      if (is_array($__v))
659      {
660          foreach ($__v as $index=>$id)
661          {
662              $object = new hitqualification_hittemplate(null,$id,$this->id,$type_id);
663              $object->deleted = false;
664              $object->hitqualification_hittemplate_type_id = $type_id;
665              $object->commit();
666              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_hitqualification")))
667              {
668                  $this->property_objects_array["{$__type}_hitqualification"] = new hitqualification($object->hitqualification_id);
669              }
670          }
671          $this->_dirty = true;
672      }
673  }
publicset_hitqualification_list ( v , type ["default"] )[ hittemplate_db ]
Parameters
requiredv
optionaltype ["default"]
Code
674  public function set_hitqualification_list($__v, $__type="default")
675  {
676      if (is_array($__v))
677      {
678          $ids = array();
679          foreach ($__v as $index=>$object)
680          {
681              $ids[] = $object->id;
682          }
683          $this->set_hitqualification_ids($ids,$__type);
684      }
685  }
publicset_hitreward ( v , type ["default"] )[ hittemplate_db ]
Parameters
requiredv
optionaltype ["default"]
Code
427  public function set_hitreward($__v, $__type="default")
428  {
429      $object = is_null(keyval($this->property_objects_array,"{$__type}_hitreward")) ? new hitreward($this->get_hitreward_id($__type)) : $this->property_objects_array["{$__type}_hitreward"];
430      if (is_null($__v))
431      {
432          $rel = new hitreward_hittemplate(null,$object->id,$this->id,hitreward_hittemplate::type_id($__type));
433          $rel->delete();
434          if (!is_null(keyval($this->property_objects_array,"{$__type}_hitreward")))
435          {
436              $this->property_objects_array["{$__type}_hitreward"] = null;
437          }
438      }
439      else
440      {
441          $id = $object->id;
442          $object = $__v;
443          $object->id = $__v->id>0 ? $__v->id : $id;
444          $object->commit();
445          $this->set_hitreward_ids(array($object->id),$__type);
446      }
447  }
publicset_hitreward_id ( v , type ["default"] )[ hittemplate_db ]
Parameters
requiredv
optionaltype ["default"]
Code
448  public function set_hitreward_id($__v, $__type="default")
449  {
450      $this->set_hitreward_ids(array($__v),$__type);
451  }
publicset_hitreward_ids ( v , type ["default"] )[ hittemplate_db ]
Parameters
requiredv
optionaltype ["default"]
Code
452  public function set_hitreward_ids($__v, $__type="default")
453  {
454      if ($this->id == 0)
455      {
456          $this->commit();
457      }
458      $type_id = hitreward_hittemplate::type_id($__type);
459      hitreward_hittemplate::delete_all(null,$this->id,$type_id);
460      if (is_array($__v))
461      {
462          foreach ($__v as $index=>$id)
463          {
464              $object = new hitreward_hittemplate(null,$id,$this->id,$type_id);
465              $object->deleted = false;
466              $object->hitreward_hittemplate_type_id = $type_id;
467              $object->commit();
468              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_hitreward")))
469              {
470                  $this->property_objects_array["{$__type}_hitreward"] = new hitreward($object->hitreward_id);
471              }
472          }
473          $this->_dirty = true;
474      }
475  }
publicset_hitreward_list ( v , type ["default"] )[ hittemplate_db ]
Parameters
requiredv
optionaltype ["default"]
Code
476  public function set_hitreward_list($__v, $__type="default")
477  {
478      if (is_array($__v))
479      {
480          $ids = array();
481          foreach ($__v as $index=>$object)
482          {
483              $ids[] = $object->id;
484          }
485          $this->set_hitreward_ids($ids,$__type);
486      }
487  }
public__toString ( )[ hittemplate_db ]
Parameters
No parameters for this method
Code
385  public function __toString()
386  {
387      return (is_null($this->name) ? "" : $this->name);
388  }
publicundelete ( )[ hittemplate_db ]
Parameters
No parameters for this method
Code
232  public function undelete()
233  {
234      $db = hittemplate::db();
235      $q  = " UPDATE aws_hittemplate SET ";
236      $q .= " deleted = 0 ";
237      $q .= " WHERE id = " . $this->_id;
238      $db->query($q);
239      $this->deleted = false;
240      return true;
241  }
protectedupdate ( )[ hittemplate_db ]
Parameters
No parameters for this method
Code
200  protected function update()
201  {
202      $db = hittemplate::db();
203      $q  = " UPDATE aws_hittemplate SET ";
204      $q .= $db->param_string("hittemplateid") . " = " . $db->value_string($this->_hittemplateid) . ", ";
205      $q .= $db->param_string("name") . " = " . $db->value_string($this->_name) . ", ";
206      $q .= $db->param_string("description") . " = " . $db->value_string($this->_description) . ", ";
207      $q .= $db->param_string("title") . " = " . $db->value_string($this->_title) . ", ";
208      $q .= $db->param_string("keywords") . " = " . $db->value_string($this->_keywords) . ", ";
209      $q .= $db->param_string("question") . " = " . $db->value_string($this->_question) . ", ";
210      $q .= $db->param_string("lifetimeinseconds") . " = " . $db->value_string($this->_lifetimeinseconds) . ", ";
211      $q .= $db->param_string("autoapprovaldelayinseconds") . " = " . $db->value_string($this->_autoapprovaldelayinseconds) . ", ";
212      $q .= $db->param_string("requesterannotation") . " = " . $db->value_string($this->_requesterannotation) . ", ";
213      $q .= $db->param_string("maxassignments") . " = " . $db->value_string($this->_maxassignments) . ", ";
214      $q .= $db->param_string("mdate") . " = " . $db->value_string(timestamp()) . ", ";
215      $q .= $db->param_string("deleted") . " = " . ($this->deleted ? "'1'" : "'0'");
216      $q .= " WHERE id = " . $this->_id;
217      $db->query($q);
218      return true;
219  }
 
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[ hittemplate_db ]
Code
252  public static function get_columns($__columns, $__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
253  {
254      $lookups = is_array($__lookups) ? $__lookups : array($__lookups);
255      $colarray = is_array($__columns) ? $__columns : explode(",",$__columns);
256      $colstring = is_array($__columns) ? implode(",",$__columns) : $__columns;
257 
258      $db = hittemplate::db();
259      $data = array();
260      $q  = " SELECT $colstring ";
261      $q .= " FROM aws_hittemplate ";
262      $q .= " WHERE aws_hittemplate.deleted = 0 ";
263      $q .= is_null($__where_clause) ? null : " AND ($__where_clause) ";
264 
265      if (is_string($__order))
266      {
267          $q .= "ORDER BY " . $__order;
268      }
269      else if (is_array($__order) and count($__order)>0)
270      {
271          $orderings = array();
272          foreach ($__order as $col=>$dir)
273          {
274              $orderings[] = " $col $dir ";
275          }
276          $q .= "ORDER BY " . implode(", ", $orderings);
277      }
278      else if (is_object($__order))
279      {
280          $q .= "";
281      }
282      else
283      {
284          // THERE IS NO `order` COLUMN ON THIS OBJECT
285      }
286 
287      if (!is_null($__limit))
288      {
289          $q .= " LIMIT $__offset , $__limit ";
290      }
291 
292      $db->query($q);
293 
294      if (count($colarray)>1 || $colstring=="*")
295      {
296          while ($db->next_record())
297          {
298              $data[] = $db->record;
299          }
300      }
301      else
302      {
303          while ($db->next_record())
304          {
305              $data[] = $db->f(0);
306          }
307      }
308 
309      return $data;
310  }
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[ hittemplate_db ]
Code
489  public function get_hit($__type="default")
490  {
491      $object = is_null(keyval($this->property_objects_array,"{$__type}_hit")) ? new hit($this->get_hit_id($__type)) : $this->property_objects_array["{$__type}_hit"];
492      $this->property_objects_array["{$__type}_hit"] = $object;
493      return $object;
494  }
Code
526  public function set_hit($__v, $__type="default")
527  {
528      $object = is_null(keyval($this->property_objects_array,"{$__type}_hit")) ? new hit($this->get_hit_id($__type)) : $this->property_objects_array["{$__type}_hit"];
529      if (is_null($__v))
530      {
531          $rel = new hit_hittemplate(null,$object->id,$this->id,hit_hittemplate::type_id($__type));
532          $rel->delete();
533          if (!is_null(keyval($this->property_objects_array,"{$__type}_hit")))
534          {
535              $this->property_objects_array["{$__type}_hit"] = null;
536          }
537      }
538      else
539      {
540          $id = $object->id;
541          $object = $__v;
542          $object->id = $__v->id>0 ? $__v->id : $id;
543          $object->commit();
544          $this->set_hit_ids(array($object->id),$__type);
545      }
546  }
publichit_id[ hittemplate_db ]
Code
495  public function get_hit_id($__type="default")
496  {
497      $ids = $this->get_hit_ids($__type, true);
498      return (count($ids)==1 ? $ids[0] : null);
499  }
Code
547  public function set_hit_id($__v, $__type="default")
548  {
549      $this->set_hit_ids(array($__v),$__type);
550  }
publichit_ids[ hittemplate_db ]
Code
500  public function get_hit_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
501  {
502      $hit_ids = array();
503      $db = hittemplate::db();
504      $q  = " SELECT aws_hit.id FROM aws_hit_hittemplate INNER JOIN aws_hit ON aws_hit_hittemplate.hit_id=aws_hit.id AND aws_hit_hittemplate.deleted=0 AND aws_hit.deleted=0 AND aws_hit_hittemplate.hittemplate_id='$this->id' " . (is_null($__type) ? "" : " AND aws_hit_hittemplate.hit_hittemplate_type_id='" . hit_hittemplate::type_id($__type) . "'") . ($__get_primary ? " AND aws_hit_hittemplate.primary=1 " : "");
505      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
506      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
507      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
508      $db->query($q);
509      while ($db->next_record())
510      {
511          $hit_ids[] = $db->f("id");
512      }
513      return $hit_ids;
514  }
Code
551  public function set_hit_ids($__v, $__type="default")
552  {
553      if ($this->id == 0)
554      {
555          $this->commit();
556      }
557      $type_id = hit_hittemplate::type_id($__type);
558      hit_hittemplate::delete_all(null,$this->id,$type_id);
559      if (is_array($__v))
560      {
561          foreach ($__v as $index=>$id)
562          {
563              $object = new hit_hittemplate(null,$id,$this->id,$type_id);
564              $object->deleted = false;
565              $object->hit_hittemplate_type_id = $type_id;
566              $object->commit();
567              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_hit")))
568              {
569                  $this->property_objects_array["{$__type}_hit"] = new hit($object->hit_id);
570              }
571          }
572          $this->_dirty = true;
573      }
574  }
publichit_list[ hittemplate_db ]
Code
515  public function get_hit_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
516  {
517      $ids = $this->get_hit_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
518      $objects = array();
519      foreach ($ids as $index=>$id)
520      {
521          $objects[$index] = new hit($id);
522      }
523      return $objects;
524  }
Code
575  public function set_hit_list($__v, $__type="default")
576  {
577      if (is_array($__v))
578      {
579          $ids = array();
580          foreach ($__v as $index=>$object)
581          {
582              $ids[] = $object->id;
583          }
584          $this->set_hit_ids($ids,$__type);
585      }
586  }
publichitqualification[ hittemplate_db ]
Code
588  public function get_hitqualification($__type="default")
589  {
590      $object = is_null(keyval($this->property_objects_array,"{$__type}_hitqualification")) ? new hitqualification($this->get_hitqualification_id($__type)) : $this->property_objects_array["{$__type}_hitqualification"];
591      $this->property_objects_array["{$__type}_hitqualification"] = $object;
592      return $object;
593  }
Code
625  public function set_hitqualification($__v, $__type="default")
626  {
627      $object = is_null(keyval($this->property_objects_array,"{$__type}_hitqualification")) ? new hitqualification($this->get_hitqualification_id($__type)) : $this->property_objects_array["{$__type}_hitqualification"];
628      if (is_null($__v))
629      {
630          $rel = new hitqualification_hittemplate(null,$object->id,$this->id,hitqualification_hittemplate::type_id($__type));
631          $rel->delete();
632          if (!is_null(keyval($this->property_objects_array,"{$__type}_hitqualification")))
633          {
634              $this->property_objects_array["{$__type}_hitqualification"] = null;
635          }
636      }
637      else
638      {
639          $id = $object->id;
640          $object = $__v;
641          $object->id = $__v->id>0 ? $__v->id : $id;
642          $object->commit();
643          $this->set_hitqualification_ids(array($object->id),$__type);
644      }
645  }
publichitqualification_id[ hittemplate_db ]
Code
594  public function get_hitqualification_id($__type="default")
595  {
596      $ids = $this->get_hitqualification_ids($__type, true);
597      return (count($ids)==1 ? $ids[0] : null);
598  }
Code
646  public function set_hitqualification_id($__v, $__type="default")
647  {
648      $this->set_hitqualification_ids(array($__v),$__type);
649  }
publichitqualification_ids[ hittemplate_db ]
Code
599  public function get_hitqualification_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
600  {
601      $hitqualification_ids = array();
602      $db = hittemplate::db();
603      $q  = " SELECT aws_hitqualification.id FROM aws_hitqualification_hittemplate INNER JOIN aws_hitqualification ON aws_hitqualification_hittemplate.hitqualification_id=aws_hitqualification.id AND aws_hitqualification_hittemplate.deleted=0 AND aws_hitqualification.deleted=0 AND aws_hitqualification_hittemplate.hittemplate_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 " : "");
604      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
605      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
606      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
607      $db->query($q);
608      while ($db->next_record())
609      {
610          $hitqualification_ids[] = $db->f("id");
611      }
612      return $hitqualification_ids;
613  }
Code
650  public function set_hitqualification_ids($__v, $__type="default")
651  {
652      if ($this->id == 0)
653      {
654          $this->commit();
655      }
656      $type_id = hitqualification_hittemplate::type_id($__type);
657      hitqualification_hittemplate::delete_all(null,$this->id,$type_id);
658      if (is_array($__v))
659      {
660          foreach ($__v as $index=>$id)
661          {
662              $object = new hitqualification_hittemplate(null,$id,$this->id,$type_id);
663              $object->deleted = false;
664              $object->hitqualification_hittemplate_type_id = $type_id;
665              $object->commit();
666              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_hitqualification")))
667              {
668                  $this->property_objects_array["{$__type}_hitqualification"] = new hitqualification($object->hitqualification_id);
669              }
670          }
671          $this->_dirty = true;
672      }
673  }
publichitqualification_list[ hittemplate_db ]
Code
614  public function get_hitqualification_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
615  {
616      $ids = $this->get_hitqualification_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
617      $objects = array();
618      foreach ($ids as $index=>$id)
619      {
620          $objects[$index] = new hitqualification($id);
621      }
622      return $objects;
623  }
Code
674  public function set_hitqualification_list($__v, $__type="default")
675  {
676      if (is_array($__v))
677      {
678          $ids = array();
679          foreach ($__v as $index=>$object)
680          {
681              $ids[] = $object->id;
682          }
683          $this->set_hitqualification_ids($ids,$__type);
684      }
685  }
publichitreward[ hittemplate_db ]
Code
390  public function get_hitreward($__type="default")
391  {
392      $object = is_null(keyval($this->property_objects_array,"{$__type}_hitreward")) ? new hitreward($this->get_hitreward_id($__type)) : $this->property_objects_array["{$__type}_hitreward"];
393      $this->property_objects_array["{$__type}_hitreward"] = $object;
394      return $object;
395  }
Code
427  public function set_hitreward($__v, $__type="default")
428  {
429      $object = is_null(keyval($this->property_objects_array,"{$__type}_hitreward")) ? new hitreward($this->get_hitreward_id($__type)) : $this->property_objects_array["{$__type}_hitreward"];
430      if (is_null($__v))
431      {
432          $rel = new hitreward_hittemplate(null,$object->id,$this->id,hitreward_hittemplate::type_id($__type));
433          $rel->delete();
434          if (!is_null(keyval($this->property_objects_array,"{$__type}_hitreward")))
435          {
436              $this->property_objects_array["{$__type}_hitreward"] = null;
437          }
438      }
439      else
440      {
441          $id = $object->id;
442          $object = $__v;
443          $object->id = $__v->id>0 ? $__v->id : $id;
444          $object->commit();
445          $this->set_hitreward_ids(array($object->id),$__type);
446      }
447  }
publichitreward_id[ hittemplate_db ]
Code
396  public function get_hitreward_id($__type="default")
397  {
398      $ids = $this->get_hitreward_ids($__type, true);
399      return (count($ids)==1 ? $ids[0] : null);
400  }
Code
448  public function set_hitreward_id($__v, $__type="default")
449  {
450      $this->set_hitreward_ids(array($__v),$__type);
451  }
publichitreward_ids[ hittemplate_db ]
Code
401  public function get_hitreward_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
402  {
403      $hitreward_ids = array();
404      $db = hittemplate::db();
405      $q  = " SELECT aws_hitreward.id FROM aws_hitreward_hittemplate INNER JOIN aws_hitreward ON aws_hitreward_hittemplate.hitreward_id=aws_hitreward.id AND aws_hitreward_hittemplate.deleted=0 AND aws_hitreward.deleted=0 AND aws_hitreward_hittemplate.hittemplate_id='$this->id' " . (is_null($__type) ? "" : " AND aws_hitreward_hittemplate.hitreward_hittemplate_type_id='" . hitreward_hittemplate::type_id($__type) . "'") . ($__get_primary ? " AND aws_hitreward_hittemplate.primary=1 " : "");
406      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
407      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
408      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
409      $db->query($q);
410      while ($db->next_record())
411      {
412          $hitreward_ids[] = $db->f("id");
413      }
414      return $hitreward_ids;
415  }
Code
452  public function set_hitreward_ids($__v, $__type="default")
453  {
454      if ($this->id == 0)
455      {
456          $this->commit();
457      }
458      $type_id = hitreward_hittemplate::type_id($__type);
459      hitreward_hittemplate::delete_all(null,$this->id,$type_id);
460      if (is_array($__v))
461      {
462          foreach ($__v as $index=>$id)
463          {
464              $object = new hitreward_hittemplate(null,$id,$this->id,$type_id);
465              $object->deleted = false;
466              $object->hitreward_hittemplate_type_id = $type_id;
467              $object->commit();
468              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_hitreward")))
469              {
470                  $this->property_objects_array["{$__type}_hitreward"] = new hitreward($object->hitreward_id);
471              }
472          }
473          $this->_dirty = true;
474      }
475  }
publichitreward_list[ hittemplate_db ]
Code
416  public function get_hitreward_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
417  {
418      $ids = $this->get_hitreward_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
419      $objects = array();
420      foreach ($ids as $index=>$id)
421      {
422          $objects[$index] = new hitreward($id);
423      }
424      return $objects;
425  }
Code
476  public function set_hitreward_list($__v, $__type="default")
477  {
478      if (is_array($__v))
479      {
480          $ids = array();
481          foreach ($__v as $index=>$object)
482          {
483              $ids[] = $object->id;
484          }
485          $this->set_hitreward_ids($ids,$__type);
486      }
487  }
publicids[ hittemplate_db ]
Code
312  public static function get_ids($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
313  {
314      return hittemplate::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset);
315  }
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[ hittemplate_db ]
Code
317  public static function get_objects($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
318  {
319      $objects = array();
320      foreach (hittemplate::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset) as $id)
321      {
322          $objects[] = new hittemplate($id);
323      }
324      return $objects;
325  }
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