Helix Installation   Getting Started   Reference Documentation   Global Functions   Quick Start
ModulesClassesFunctions
 

Class Reference

class hitassignment extends hitassignment_ext

Hide Inherited MembersAmazon Web Services
Description
No description.
 
Constants
constantTABLENAME ["aws_hitassignment"][ hitassignment ]
 
Properties
protected_answer[ hitassignment_db ]
protected_answer_dirty[ hitassignment_db ]
protected_cdate[ hitassignment_db ]
protected_cdate_dirty[ hitassignment_db ]
protected_deleted[ hitassignment_db ]
protected_deleted_dirty[ hitassignment_db ]
protected_dirty[ obj ]
protected_hitassignmentid[ hitassignment_db ]
protected_hitassignmentid_dirty[ hitassignment_db ]
protected_hitassignmentstatus_id[ hitassignment_db ]
protected_hitassignmentstatus_id_dirty[ hitassignment_db ]
protected_id[ hitassignment_db ]
protected_id_dirty[ hitassignment_db ]
protected_mdate[ hitassignment_db ]
protected_mdate_dirty[ hitassignment_db ]
publicproperty_objects_array[ obj ]
protected_requesterfeedback[ hitassignment_db ]
protected_requesterfeedback_dirty[ hitassignment_db ]
 
Methods
publiccommit ( )[ hitassignment_db ]
Parameters
No parameters for this method
Code
108  public function commit()
109  {
110      if ($this->_id > 0)
111      {
112          $this->update();
113      }
114      else
115      {
116          $this->insert();
117      }
118 
119      foreach ($this->property_objects_array as $property=>$object)
120      {
121          $this->{$property} = $object;
122      }
123 
124      return true;
125  }
public__construct ( id , hitassignmentid )[ hitassignment_db ]
Parameters
optionalid
optionalhitassignmentid
Code
046  public function __construct($__id=null, $__hitassignmentid=null)
047  {
048      $this->_id = 0;
049      $this->_hitassignmentid = $__hitassignmentid;
050      $this->_hitassignmentstatus_id = 0;
051      $this->_answer = "";
052      $this->_requesterfeedback = "";
053      $this->_mdate = null;
054      $this->_cdate = null;
055      $this->_deleted = false;
056 
057      $this->_id_dirty = false;
058      $this->_hitassignmentid_dirty = false;
059      $this->_hitassignmentstatus_id_dirty = false;
060      $this->_answer_dirty = false;
061      $this->_requesterfeedback_dirty = false;
062      $this->_mdate_dirty = false;
063      $this->_cdate_dirty = false;
064      $this->_deleted_dirty = false;
065 
066      if (is_null($__id) && is_null($__hitassignmentid))
067      {
068          return;
069      }
070 
071      $db = hitassignment::db();
072      $q  = " SELECT aws_hitassignment.id,aws_hitassignment.hitassignmentid,aws_hitassignment.hitassignmentstatus_id,aws_hitassignment.answer,aws_hitassignment.requesterfeedback,aws_hitassignment.mdate,aws_hitassignment.cdate,aws_hitassignment.deleted ";
073      $q .= " FROM aws_hitassignment ";       
074      if (!is_null($__id))
075      {
076          $q .= " WHERE id = '$__id' ";
077      }
078      else if (!is_null($__hitassignmentid))
079      {
080          $q .= " WHERE hitassignmentid = '$__hitassignmentid' ";
081      }
082 
083      $db->query($q);
084      if ($db->next_record() && $db->num_rows() == 1)
085      {
086          $this->_id = $db->f("id");
087          $this->_hitassignmentid = $db->f("hitassignmentid");
088          $this->_hitassignmentstatus_id = $db->f("hitassignmentstatus_id");
089          $this->_answer = $db->f("answer");
090          $this->_requesterfeedback = $db->f("requesterfeedback");
091          $this->_mdate = $db->f("mdate");
092          $this->_cdate = $db->f("cdate");
093          $this->_deleted = $db->f("deleted");
094      }
095  }
protected staticdb ( )[ hitassignment_db ]
Parameters
No parameters for this method
Code
645  protected static function db()
646  {
647      return new db();
648  }
publicdelete ( )[ hitassignment_db ]
Parameters
No parameters for this method
Code
167  public function delete()
168  {
169      $db = hitassignment::db();
170      $q  = " UPDATE aws_hitassignment SET ";
171      $q .= " deleted = 1 ";
172      $q .= " WHERE id = " . $this->_id;
173      $db->query($q);
174      $this->deleted = true;
175      return true;
176  }
public staticdelete_all ( )[ hitassignment_db ]
Parameters
No parameters for this method
Code
274  public static function delete_all()
275  {
276      $db = hitassignment::db();
277      $q  = " UPDATE aws_hitassignment SET ";
278      $q .= " deleted = 1 ";
279     
280      $db->query($q);
281      return true;
282  }
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] )[ hitassignment_db ]
Parameters
requiredcolumns
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
198  public static function get_columns($__columns, $__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
199  {
200      $lookups = is_array($__lookups) ? $__lookups : array($__lookups);
201      $colarray = is_array($__columns) ? $__columns : explode(",",$__columns);
202      $colstring = is_array($__columns) ? implode(",",$__columns) : $__columns;
203 
204      $db = hitassignment::db();
205      $data = array();
206      $q  = " SELECT $colstring ";
207      $q .= " FROM aws_hitassignment ";
208      $q .= " WHERE aws_hitassignment.deleted = 0 ";
209      $q .= is_null($__where_clause) ? null : " AND ($__where_clause) ";
210      $q .= array_key_exists("hitassignmentstatus_id",$lookups) ? " AND aws_hitassignment.hitassignmentstatus_id='" . $lookups["hitassignmentstatus_id"] . "' " : "";
211 
212      if (is_string($__order))
213      {
214          $q .= "ORDER BY " . $__order;
215      }
216      else if (is_array($__order) and count($__order)>0)
217      {
218          $orderings = array();
219          foreach ($__order as $col=>$dir)
220          {
221              $orderings[] = " $col $dir ";
222          }
223          $q .= "ORDER BY " . implode(", ", $orderings);
224      }
225      else if (is_object($__order))
226      {
227          $q .= "";
228      }
229      else
230      {
231          // THERE IS NO `order` COLUMN ON THIS OBJECT
232      }
233 
234      if (!is_null($__limit))
235      {
236          $q .= " LIMIT $__offset , $__limit ";
237      }
238 
239      $db->query($q);
240 
241      if (count($colarray)>1 || $colstring=="*")
242      {
243          while ($db->next_record())
244          {
245              $data[] = $db->record;
246          }
247      }
248      else
249      {
250          while ($db->next_record())
251          {
252              $data[] = $db->f(0);
253          }
254      }
255 
256      return $data;
257  }
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"] )[ hitassignment_db ]
Parameters
optionaltype ["default"]
Code
546  public function get_hit($__type="default")
547  {
548      $object = is_null(keyval($this->property_objects_array,"{$__type}_hit")) ? new hit($this->get_hit_id($__type)) : $this->property_objects_array["{$__type}_hit"];
549      $this->property_objects_array["{$__type}_hit"] = $object;
550      return $object;
551  }
publicget_hit_id ( type ["default"] )[ hitassignment_db ]
Parameters
optionaltype ["default"]
Code
552  public function get_hit_id($__type="default")
553  {
554      $ids = $this->get_hit_ids($__type, true);
555      return (count($ids)==1 ? $ids[0] : null);
556  }
publicget_hit_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ hitassignment_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
557  public function get_hit_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
558  {
559      $hit_ids = array();
560      $db = hitassignment::db();
561      $q  = " SELECT aws_hit.id FROM aws_hit_hitassignment INNER JOIN aws_hit ON aws_hit_hitassignment.hit_id=aws_hit.id AND aws_hit_hitassignment.deleted=0 AND aws_hit.deleted=0 AND aws_hit_hitassignment.hitassignment_id='$this->id' " . (is_null($__type) ? "" : " AND aws_hit_hitassignment.hit_hitassignment_type_id='" . hit_hitassignment::type_id($__type) . "'") . ($__get_primary ? " AND aws_hit_hitassignment.primary=1 " : "");
562      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
563      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
564      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
565      $db->query($q);
566      while ($db->next_record())
567      {
568          $hit_ids[] = $db->f("id");
569      }
570      return $hit_ids;
571  }
publicget_hit_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ hitassignment_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
572  public function get_hit_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
573  {
574      $ids = $this->get_hit_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
575      $objects = array();
576      foreach ($ids as $index=>$id)
577      {
578          $objects[$index] = new hit($id);
579      }
580      return $objects;
581  }
publicget_hitassignmentdate ( type ["default"] )[ hitassignment_db ]
Parameters
optionaltype ["default"]
Code
349  public function get_hitassignmentdate($__type="default")
350  {
351      $object = is_null(keyval($this->property_objects_array,"{$__type}_hitassignmentdate")) ? new hitassignmentdate($this->get_hitassignmentdate_id($__type)) : $this->property_objects_array["{$__type}_hitassignmentdate"];
352      $this->property_objects_array["{$__type}_hitassignmentdate"] = $object;
353      return $object;
354  }
publicget_hitassignmentdate_id ( type ["default"] )[ hitassignment_db ]
Parameters
optionaltype ["default"]
Code
355  public function get_hitassignmentdate_id($__type="default")
356  {
357      $ids = $this->get_hitassignmentdate_ids($__type, true);
358      return (count($ids)==1 ? $ids[0] : null);
359  }
publicget_hitassignmentdate_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ hitassignment_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
360  public function get_hitassignmentdate_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
361  {
362      $hitassignmentdate_ids = array();
363      $db = hitassignment::db();
364      $q  = " SELECT aws_hitassignmentdate.id FROM aws_hitassignment_hitassignmentdate INNER JOIN aws_hitassignmentdate ON aws_hitassignment_hitassignmentdate.hitassignmentdate_id=aws_hitassignmentdate.id AND aws_hitassignment_hitassignmentdate.deleted=0 AND aws_hitassignmentdate.deleted=0 AND aws_hitassignment_hitassignmentdate.hitassignment_id='$this->id' " . (is_null($__type) ? "" : " AND aws_hitassignment_hitassignmentdate.hitassignment_hitassignmentdate_type_id='" . hitassignment_hitassignmentdate::type_id($__type) . "'") . ($__get_primary ? " AND aws_hitassignment_hitassignmentdate.primary=1 " : "");
365      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
366      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
367      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
368      $db->query($q);
369      while ($db->next_record())
370      {
371          $hitassignmentdate_ids[] = $db->f("id");
372      }
373      return $hitassignmentdate_ids;
374  }
publicget_hitassignmentdate_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ hitassignment_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
375  public function get_hitassignmentdate_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
376  {
377      $ids = $this->get_hitassignmentdate_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
378      $objects = array();
379      foreach ($ids as $index=>$id)
380      {
381          $objects[$index] = new hitassignmentdate($id);
382      }
383      return $objects;
384  }
publicget_hitassignmentstatus ( )[ hitassignment_db ]
Parameters
No parameters for this method
Code
337  public function get_hitassignmentstatus()
338  {
339      return new hitassignmentstatus($this->hitassignmentstatus_id);
340  }
public staticget_ids ( order , lookups , where_clause , limit , offset [0] )[ hitassignment_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
259  public static function get_ids($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
260  {
261      return hitassignment::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset);
262  }
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] )[ hitassignment_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
264  public static function get_objects($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
265  {
266      $objects = array();
267      foreach (hitassignment::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset) as $id)
268      {
269          $objects[] = new hitassignment($id);
270      }
271      return $objects;
272  }
publicget_properties ( )[ obj ]
Parameters
No parameters for this method
Code
121  public function get_properties()
122  {
123      return array_keys($this->array);
124  }
protectedget_string ( )[ obj ]
Parameters
No parameters for this method
Code
091  protected function get_string()
092  {
093      return method_exists($this,"__toString") ? $this->__toString() : null;
094  }
publicget_turk ( type ["default"] )[ hitassignment_db ]
Parameters
optionaltype ["default"]
Code
447  public function get_turk($__type="default")
448  {
449      $object = is_null(keyval($this->property_objects_array,"{$__type}_turk")) ? new turk($this->get_turk_id($__type)) : $this->property_objects_array["{$__type}_turk"];
450      $this->property_objects_array["{$__type}_turk"] = $object;
451      return $object;
452  }
publicget_turk_id ( type ["default"] )[ hitassignment_db ]
Parameters
optionaltype ["default"]
Code
453  public function get_turk_id($__type="default")
454  {
455      $ids = $this->get_turk_ids($__type, true);
456      return (count($ids)==1 ? $ids[0] : null);
457  }
publicget_turk_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ hitassignment_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
458  public function get_turk_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
459  {
460      $turk_ids = array();
461      $db = hitassignment::db();
462      $q  = " SELECT aws_turk.person_entity_id FROM aws_hitassignment_turk INNER JOIN aws_turk ON aws_hitassignment_turk.turk_person_entity_id=aws_turk.person_entity_id AND aws_hitassignment_turk.deleted=0 AND aws_turk.deleted=0 AND aws_hitassignment_turk.hitassignment_id='$this->id' " . (is_null($__type) ? "" : " AND aws_hitassignment_turk.hitassignment_turk_type_id='" . hitassignment_turk::type_id($__type) . "'") . ($__get_primary ? " AND aws_hitassignment_turk.primary=1 " : "");
463      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
464      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
465      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
466      $db->query($q);
467      while ($db->next_record())
468      {
469          $turk_ids[] = $db->f("person_entity_id");
470      }
471      return $turk_ids;
472  }
publicget_turk_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ hitassignment_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
473  public function get_turk_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
474  {
475      $ids = $this->get_turk_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
476      $objects = array();
477      foreach ($ids as $index=>$id)
478      {
479          $objects[$index] = new turk($id);
480      }
481      return $objects;
482  }
publicget_worktimeinseconds ( )[ hitassignment_ext ]
Parameters
No parameters for this method
Code
026  public function get_worktimeinseconds()
027  {
028      return strtotime($this->submit_hitassignmentdate->value)-strtotime($this->accept_hitassignmentdate->value);
029  }
protectedinsert ( )[ hitassignment_db ]
Parameters
No parameters for this method
Code
127  protected function insert()
128  {
129      $db = hitassignment::db();
130      $q  = " INSERT INTO aws_hitassignment ( ";
131      $q .= $db->param_string("hitassignmentid") . ", ";
132      $q .= $db->param_string("hitassignmentstatus_id") . ", ";
133      $q .= $db->param_string("answer") . ", ";
134      $q .= $db->param_string("requesterfeedback") . ", ";
135      $q .= $db->param_string("mdate") . ", ";
136      $q .= $db->param_string("cdate") . ", ";
137      $q .= $db->param_string("deleted");
138      $q .= " ) VALUES ( ";
139      $q .= $db->value_string($this->_hitassignmentid) . ", ";
140      $q .= $db->value_string($this->_hitassignmentstatus_id) . ", ";
141      $q .= $db->value_string($this->_answer) . ", ";
142      $q .= $db->value_string($this->_requesterfeedback) . ", ";
143      $q .= $db->value_string(timestamp()) . ", ";
144      $q .= $db->value_string(timestamp()) . ", ";
145      $q .= $this->deleted ? "'1'" : "'0'";
146      $q .= " ) ";
147      $db->query($q);
148      $this->_id = $db->insert_id;
149      return true;
150  }
publicmap ( )[ hitassignment_db ]
Parameters
No parameters for this method
Code
097  public function map()
098  {
099      $this->_hitassignmentid = array_key_exists("hitassignment:hitassignmentid",$_REQUEST) ? reqval("hitassignment:hitassignmentid") : $this->_hitassignmentid;
100      $this->_hitassignmentstatus_id = array_key_exists("hitassignment:hitassignmentstatus_id",$_REQUEST) ? reqval("hitassignment:hitassignmentstatus_id") : $this->_hitassignmentstatus_id;
101      $this->_answer = array_key_exists("hitassignment:answer",$_REQUEST) ? reqval("hitassignment:answer") : $this->_answer;
102      $this->_requesterfeedback = array_key_exists("hitassignment:requesterfeedback",$_REQUEST) ? reqval("hitassignment:requesterfeedback") : $this->_requesterfeedback;
103      $this->_mdate = array_key_exists("hitassignment:mdate",$_REQUEST) ? reqval("hitassignment:mdate") : $this->_mdate;
104      $this->_cdate = array_key_exists("hitassignment:cdate",$_REQUEST) ? reqval("hitassignment:cdate") : $this->_cdate;
105      $this->_deleted = array_key_exists("hitassignment:deleted",$_REQUEST) ? reqval("hitassignment:deleted") : $this->_deleted;
106  }
publicpurge ( )[ hitassignment_db ]
Parameters
No parameters for this method
Code
189  public function purge()
190  {
191      $db = hitassignment::db();
192      $q  = " DELETE FROM aws_hitassignment ";
193      $q .= " WHERE id = " . $this->_id;
194      $db->query($q);
195      return true;
196  }
public staticsearch ( keyword )[ hitassignment_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"] )[ hitassignment_db ]
Parameters
requiredv
optionaltype ["default"]
Code
583  public function set_hit($__v, $__type="default")
584  {
585      $object = is_null(keyval($this->property_objects_array,"{$__type}_hit")) ? new hit($this->get_hit_id($__type)) : $this->property_objects_array["{$__type}_hit"];
586      if (is_null($__v))
587      {
588          $rel = new hit_hitassignment(null,$object->id,$this->id,hit_hitassignment::type_id($__type));
589          $rel->delete();
590          if (!is_null(keyval($this->property_objects_array,"{$__type}_hit")))
591          {
592              $this->property_objects_array["{$__type}_hit"] = null;
593          }
594      }
595      else
596      {
597          $id = $object->id;
598          $object = $__v;
599          $object->id = $__v->id>0 ? $__v->id : $id;
600          $object->commit();
601          $this->set_hit_ids(array($object->id),$__type);
602      }
603  }
publicset_hit_id ( v , type ["default"] )[ hitassignment_db ]
Parameters
requiredv
optionaltype ["default"]
Code
604  public function set_hit_id($__v, $__type="default")
605  {
606      $this->set_hit_ids(array($__v),$__type);
607  }
publicset_hit_ids ( v , type ["default"] )[ hitassignment_db ]
Parameters
requiredv
optionaltype ["default"]
Code
608  public function set_hit_ids($__v, $__type="default")
609  {
610      if ($this->id == 0)
611      {
612          $this->commit();
613      }
614      $type_id = hit_hitassignment::type_id($__type);
615      hit_hitassignment::delete_all(null,$this->id,$type_id);
616      if (is_array($__v))
617      {
618          foreach ($__v as $index=>$id)
619          {
620              $object = new hit_hitassignment(null,$id,$this->id,$type_id);
621              $object->deleted = false;
622              $object->hit_hitassignment_type_id = $type_id;
623              $object->commit();
624              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_hit")))
625              {
626                  $this->property_objects_array["{$__type}_hit"] = new hit($object->hit_id);
627              }
628          }
629          $this->_dirty = true;
630      }
631  }
publicset_hit_list ( v , type ["default"] )[ hitassignment_db ]
Parameters
requiredv
optionaltype ["default"]
Code
632  public function set_hit_list($__v, $__type="default")
633  {
634      if (is_array($__v))
635      {
636          $ids = array();
637          foreach ($__v as $index=>$object)
638          {
639              $ids[] = $object->id;
640          }
641          $this->set_hit_ids($ids,$__type);
642      }
643  }
publicset_hitassignmentdate ( v , type ["default"] )[ hitassignment_db ]
Parameters
requiredv
optionaltype ["default"]
Code
386  public function set_hitassignmentdate($__v, $__type="default")
387  {
388      $object = is_null(keyval($this->property_objects_array,"{$__type}_hitassignmentdate")) ? new hitassignmentdate($this->get_hitassignmentdate_id($__type)) : $this->property_objects_array["{$__type}_hitassignmentdate"];
389      if (is_null($__v))
390      {
391          $rel = new hitassignment_hitassignmentdate(null,$this->id,$object->id,hitassignment_hitassignmentdate::type_id($__type));
392          $rel->delete();
393          $object->delete();
394          if (!is_null(keyval($this->property_objects_array,"{$__type}_hitassignmentdate")))
395          {
396              $this->property_objects_array["{$__type}_hitassignmentdate"] = null;
397          }
398      }
399      else
400      {
401          $object->value = is_object($__v) ? $__v->value : $__v;
402          $object->commit();
403          $this->set_hitassignmentdate_ids(array($object->id),$__type);
404      }
405  }
publicset_hitassignmentdate_id ( v , type ["default"] )[ hitassignment_db ]
Parameters
requiredv
optionaltype ["default"]
Code
406  public function set_hitassignmentdate_id($__v, $__type="default")
407  {
408      $this->set_hitassignmentdate_ids(array($__v),$__type);
409  }
publicset_hitassignmentdate_ids ( v , type ["default"] )[ hitassignment_db ]
Parameters
requiredv
optionaltype ["default"]
Code
410  public function set_hitassignmentdate_ids($__v, $__type="default")
411  {
412      if ($this->id == 0)
413      {
414          $this->commit();
415      }
416      $type_id = hitassignment_hitassignmentdate::type_id($__type);
417      hitassignment_hitassignmentdate::delete_all($this->id,null,$type_id);
418      if (is_array($__v))
419      {
420          foreach ($__v as $index=>$id)
421          {
422              $object = new hitassignment_hitassignmentdate(null,$this->id,$id,$type_id);
423              $object->deleted = false;
424              $object->hitassignment_hitassignmentdate_type_id = $type_id;
425              $object->commit();
426              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_hitassignmentdate")))
427              {
428                  $this->property_objects_array["{$__type}_hitassignmentdate"] = new hitassignmentdate($object->hitassignmentdate_id);
429              }
430          }
431          $this->_dirty = true;
432      }
433  }
publicset_hitassignmentdate_list ( v , type ["default"] )[ hitassignment_db ]
Parameters
requiredv
optionaltype ["default"]
Code
434  public function set_hitassignmentdate_list($__v, $__type="default")
435  {
436      if (is_array($__v))
437      {
438          $ids = array();
439          foreach ($__v as $index=>$object)
440          {
441              $ids[] = $object->id;
442          }
443          $this->set_hitassignmentdate_ids($ids,$__type);
444      }
445  }
publicset_hitassignmentstatus ( v )[ hitassignment_db ]
Parameters
requiredv
Code
341  public function set_hitassignmentstatus($v)
342  {
343      if ($v->id > 0)
344      {
345          $this->hitassignmentstatus_id = $v->id;
346      }
347  }
publicset_turk ( v , type ["default"] )[ hitassignment_db ]
Parameters
requiredv
optionaltype ["default"]
Code
484  public function set_turk($__v, $__type="default")
485  {
486      $object = is_null(keyval($this->property_objects_array,"{$__type}_turk")) ? new turk($this->get_turk_id($__type)) : $this->property_objects_array["{$__type}_turk"];
487      if (is_null($__v))
488      {
489          $rel = new hitassignment_turk(null,$this->id,$object->id,hitassignment_turk::type_id($__type));
490          $rel->delete();
491          if (!is_null(keyval($this->property_objects_array,"{$__type}_turk")))
492          {
493              $this->property_objects_array["{$__type}_turk"] = null;
494          }
495      }
496      else
497      {
498          $id = $object->id;
499          $object = $__v;
500          $object->id = $__v->id>0 ? $__v->id : $id;
501          $object->commit();
502          $this->set_turk_ids(array($object->id),$__type);
503      }
504  }
publicset_turk_id ( v , type ["default"] )[ hitassignment_db ]
Parameters
requiredv
optionaltype ["default"]
Code
505  public function set_turk_id($__v, $__type="default")
506  {
507      $this->set_turk_ids(array($__v),$__type);
508  }
publicset_turk_ids ( v , type ["default"] )[ hitassignment_db ]
Parameters
requiredv
optionaltype ["default"]
Code
509  public function set_turk_ids($__v, $__type="default")
510  {
511      if ($this->id == 0)
512      {
513          $this->commit();
514      }
515      $type_id = hitassignment_turk::type_id($__type);
516      hitassignment_turk::delete_all($this->id,null,$type_id);
517      if (is_array($__v))
518      {
519          foreach ($__v as $index=>$id)
520          {
521              $object = new hitassignment_turk(null,$this->id,$id,$type_id);
522              $object->deleted = false;
523              $object->hitassignment_turk_type_id = $type_id;
524              $object->commit();
525              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_turk")))
526              {
527                  $this->property_objects_array["{$__type}_turk"] = new turk($object->turk_id);
528              }
529          }
530          $this->_dirty = true;
531      }
532  }
publicset_turk_list ( v , type ["default"] )[ hitassignment_db ]
Parameters
requiredv
optionaltype ["default"]
Code
533  public function set_turk_list($__v, $__type="default")
534  {
535      if (is_array($__v))
536      {
537          $ids = array();
538          foreach ($__v as $index=>$object)
539          {
540              $ids[] = $object->id;
541          }
542          $this->set_turk_ids($ids,$__type);
543      }
544  }
public__toString ( )[ hitassignment_db ]
Parameters
No parameters for this method
Code
332  public function __toString()
333  {
334      return (is_null($this->id) ? "" : $this->id);
335  }
publicundelete ( )[ hitassignment_db ]
Parameters
No parameters for this method
Code
178  public function undelete()
179  {
180      $db = hitassignment::db();
181      $q  = " UPDATE aws_hitassignment SET ";
182      $q .= " deleted = 0 ";
183      $q .= " WHERE id = " . $this->_id;
184      $db->query($q);
185      $this->deleted = false;
186      return true;
187  }
protectedupdate ( )[ hitassignment_db ]
Parameters
No parameters for this method
Code
152  protected function update()
153  {
154      $db = hitassignment::db();
155      $q  = " UPDATE aws_hitassignment SET ";
156      $q .= $db->param_string("hitassignmentid") . " = " . $db->value_string($this->_hitassignmentid) . ", ";
157      $q .= $db->param_string("hitassignmentstatus_id") . " = " . $db->value_string($this->_hitassignmentstatus_id) . ", ";
158      $q .= $db->param_string("answer") . " = " . $db->value_string($this->_answer) . ", ";
159      $q .= $db->param_string("requesterfeedback") . " = " . $db->value_string($this->_requesterfeedback) . ", ";
160      $q .= $db->param_string("mdate") . " = " . $db->value_string(timestamp()) . ", ";
161      $q .= $db->param_string("deleted") . " = " . ($this->deleted ? "'1'" : "'0'");
162      $q .= " WHERE id = " . $this->_id;
163      $db->query($q);
164      return true;
165  }
 
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[ hitassignment_db ]
Code
198  public static function get_columns($__columns, $__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
199  {
200      $lookups = is_array($__lookups) ? $__lookups : array($__lookups);
201      $colarray = is_array($__columns) ? $__columns : explode(",",$__columns);
202      $colstring = is_array($__columns) ? implode(",",$__columns) : $__columns;
203 
204      $db = hitassignment::db();
205      $data = array();
206      $q  = " SELECT $colstring ";
207      $q .= " FROM aws_hitassignment ";
208      $q .= " WHERE aws_hitassignment.deleted = 0 ";
209      $q .= is_null($__where_clause) ? null : " AND ($__where_clause) ";
210      $q .= array_key_exists("hitassignmentstatus_id",$lookups) ? " AND aws_hitassignment.hitassignmentstatus_id='" . $lookups["hitassignmentstatus_id"] . "' " : "";
211 
212      if (is_string($__order))
213      {
214          $q .= "ORDER BY " . $__order;
215      }
216      else if (is_array($__order) and count($__order)>0)
217      {
218          $orderings = array();
219          foreach ($__order as $col=>$dir)
220          {
221              $orderings[] = " $col $dir ";
222          }
223          $q .= "ORDER BY " . implode(", ", $orderings);
224      }
225      else if (is_object($__order))
226      {
227          $q .= "";
228      }
229      else
230      {
231          // THERE IS NO `order` COLUMN ON THIS OBJECT
232      }
233 
234      if (!is_null($__limit))
235      {
236          $q .= " LIMIT $__offset , $__limit ";
237      }
238 
239      $db->query($q);
240 
241      if (count($colarray)>1 || $colstring=="*")
242      {
243          while ($db->next_record())
244          {
245              $data[] = $db->record;
246          }
247      }
248      else
249      {
250          while ($db->next_record())
251          {
252              $data[] = $db->f(0);
253          }
254      }
255 
256      return $data;
257  }
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[ hitassignment_db ]
Code
546  public function get_hit($__type="default")
547  {
548      $object = is_null(keyval($this->property_objects_array,"{$__type}_hit")) ? new hit($this->get_hit_id($__type)) : $this->property_objects_array["{$__type}_hit"];
549      $this->property_objects_array["{$__type}_hit"] = $object;
550      return $object;
551  }
Code
583  public function set_hit($__v, $__type="default")
584  {
585      $object = is_null(keyval($this->property_objects_array,"{$__type}_hit")) ? new hit($this->get_hit_id($__type)) : $this->property_objects_array["{$__type}_hit"];
586      if (is_null($__v))
587      {
588          $rel = new hit_hitassignment(null,$object->id,$this->id,hit_hitassignment::type_id($__type));
589          $rel->delete();
590          if (!is_null(keyval($this->property_objects_array,"{$__type}_hit")))
591          {
592              $this->property_objects_array["{$__type}_hit"] = null;
593          }
594      }
595      else
596      {
597          $id = $object->id;
598          $object = $__v;
599          $object->id = $__v->id>0 ? $__v->id : $id;
600          $object->commit();
601          $this->set_hit_ids(array($object->id),$__type);
602      }
603  }
publichit_id[ hitassignment_db ]
Code
552  public function get_hit_id($__type="default")
553  {
554      $ids = $this->get_hit_ids($__type, true);
555      return (count($ids)==1 ? $ids[0] : null);
556  }
Code
604  public function set_hit_id($__v, $__type="default")
605  {
606      $this->set_hit_ids(array($__v),$__type);
607  }
publichit_ids[ hitassignment_db ]
Code
557  public function get_hit_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
558  {
559      $hit_ids = array();
560      $db = hitassignment::db();
561      $q  = " SELECT aws_hit.id FROM aws_hit_hitassignment INNER JOIN aws_hit ON aws_hit_hitassignment.hit_id=aws_hit.id AND aws_hit_hitassignment.deleted=0 AND aws_hit.deleted=0 AND aws_hit_hitassignment.hitassignment_id='$this->id' " . (is_null($__type) ? "" : " AND aws_hit_hitassignment.hit_hitassignment_type_id='" . hit_hitassignment::type_id($__type) . "'") . ($__get_primary ? " AND aws_hit_hitassignment.primary=1 " : "");
562      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
563      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
564      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
565      $db->query($q);
566      while ($db->next_record())
567      {
568          $hit_ids[] = $db->f("id");
569      }
570      return $hit_ids;
571  }
Code
608  public function set_hit_ids($__v, $__type="default")
609  {
610      if ($this->id == 0)
611      {
612          $this->commit();
613      }
614      $type_id = hit_hitassignment::type_id($__type);
615      hit_hitassignment::delete_all(null,$this->id,$type_id);
616      if (is_array($__v))
617      {
618          foreach ($__v as $index=>$id)
619          {
620              $object = new hit_hitassignment(null,$id,$this->id,$type_id);
621              $object->deleted = false;
622              $object->hit_hitassignment_type_id = $type_id;
623              $object->commit();
624              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_hit")))
625              {
626                  $this->property_objects_array["{$__type}_hit"] = new hit($object->hit_id);
627              }
628          }
629          $this->_dirty = true;
630      }
631  }
publichit_list[ hitassignment_db ]
Code
572  public function get_hit_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
573  {
574      $ids = $this->get_hit_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
575      $objects = array();
576      foreach ($ids as $index=>$id)
577      {
578          $objects[$index] = new hit($id);
579      }
580      return $objects;
581  }
Code
632  public function set_hit_list($__v, $__type="default")
633  {
634      if (is_array($__v))
635      {
636          $ids = array();
637          foreach ($__v as $index=>$object)
638          {
639              $ids[] = $object->id;
640          }
641          $this->set_hit_ids($ids,$__type);
642      }
643  }
publichitassignmentdate[ hitassignment_db ]
Code
349  public function get_hitassignmentdate($__type="default")
350  {
351      $object = is_null(keyval($this->property_objects_array,"{$__type}_hitassignmentdate")) ? new hitassignmentdate($this->get_hitassignmentdate_id($__type)) : $this->property_objects_array["{$__type}_hitassignmentdate"];
352      $this->property_objects_array["{$__type}_hitassignmentdate"] = $object;
353      return $object;
354  }
Code
386  public function set_hitassignmentdate($__v, $__type="default")
387  {
388      $object = is_null(keyval($this->property_objects_array,"{$__type}_hitassignmentdate")) ? new hitassignmentdate($this->get_hitassignmentdate_id($__type)) : $this->property_objects_array["{$__type}_hitassignmentdate"];
389      if (is_null($__v))
390      {
391          $rel = new hitassignment_hitassignmentdate(null,$this->id,$object->id,hitassignment_hitassignmentdate::type_id($__type));
392          $rel->delete();
393          $object->delete();
394          if (!is_null(keyval($this->property_objects_array,"{$__type}_hitassignmentdate")))
395          {
396              $this->property_objects_array["{$__type}_hitassignmentdate"] = null;
397          }
398      }
399      else
400      {
401          $object->value = is_object($__v) ? $__v->value : $__v;
402          $object->commit();
403          $this->set_hitassignmentdate_ids(array($object->id),$__type);
404      }
405  }
publichitassignmentdate_id[ hitassignment_db ]
Code
355  public function get_hitassignmentdate_id($__type="default")
356  {
357      $ids = $this->get_hitassignmentdate_ids($__type, true);
358      return (count($ids)==1 ? $ids[0] : null);
359  }
Code
406  public function set_hitassignmentdate_id($__v, $__type="default")
407  {
408      $this->set_hitassignmentdate_ids(array($__v),$__type);
409  }
publichitassignmentdate_ids[ hitassignment_db ]
Code
360  public function get_hitassignmentdate_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
361  {
362      $hitassignmentdate_ids = array();
363      $db = hitassignment::db();
364      $q  = " SELECT aws_hitassignmentdate.id FROM aws_hitassignment_hitassignmentdate INNER JOIN aws_hitassignmentdate ON aws_hitassignment_hitassignmentdate.hitassignmentdate_id=aws_hitassignmentdate.id AND aws_hitassignment_hitassignmentdate.deleted=0 AND aws_hitassignmentdate.deleted=0 AND aws_hitassignment_hitassignmentdate.hitassignment_id='$this->id' " . (is_null($__type) ? "" : " AND aws_hitassignment_hitassignmentdate.hitassignment_hitassignmentdate_type_id='" . hitassignment_hitassignmentdate::type_id($__type) . "'") . ($__get_primary ? " AND aws_hitassignment_hitassignmentdate.primary=1 " : "");
365      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
366      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
367      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
368      $db->query($q);
369      while ($db->next_record())
370      {
371          $hitassignmentdate_ids[] = $db->f("id");
372      }
373      return $hitassignmentdate_ids;
374  }
Code
410  public function set_hitassignmentdate_ids($__v, $__type="default")
411  {
412      if ($this->id == 0)
413      {
414          $this->commit();
415      }
416      $type_id = hitassignment_hitassignmentdate::type_id($__type);
417      hitassignment_hitassignmentdate::delete_all($this->id,null,$type_id);
418      if (is_array($__v))
419      {
420          foreach ($__v as $index=>$id)
421          {
422              $object = new hitassignment_hitassignmentdate(null,$this->id,$id,$type_id);
423              $object->deleted = false;
424              $object->hitassignment_hitassignmentdate_type_id = $type_id;
425              $object->commit();
426              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_hitassignmentdate")))
427              {
428                  $this->property_objects_array["{$__type}_hitassignmentdate"] = new hitassignmentdate($object->hitassignmentdate_id);
429              }
430          }
431          $this->_dirty = true;
432      }
433  }
publichitassignmentdate_list[ hitassignment_db ]
Code
375  public function get_hitassignmentdate_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
376  {
377      $ids = $this->get_hitassignmentdate_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
378      $objects = array();
379      foreach ($ids as $index=>$id)
380      {
381          $objects[$index] = new hitassignmentdate($id);
382      }
383      return $objects;
384  }
Code
434  public function set_hitassignmentdate_list($__v, $__type="default")
435  {
436      if (is_array($__v))
437      {
438          $ids = array();
439          foreach ($__v as $index=>$object)
440          {
441              $ids[] = $object->id;
442          }
443          $this->set_hitassignmentdate_ids($ids,$__type);
444      }
445  }
publichitassignmentstatus[ hitassignment_db ]
Code
337  public function get_hitassignmentstatus()
338  {
339      return new hitassignmentstatus($this->hitassignmentstatus_id);
340  }
Code
341  public function set_hitassignmentstatus($v)
342  {
343      if ($v->id > 0)
344      {
345          $this->hitassignmentstatus_id = $v->id;
346      }
347  }
publicids[ hitassignment_db ]
Code
259  public static function get_ids($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
260  {
261      return hitassignment::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset);
262  }
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[ hitassignment_db ]
Code
264  public static function get_objects($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
265  {
266      $objects = array();
267      foreach (hitassignment::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset) as $id)
268      {
269          $objects[] = new hitassignment($id);
270      }
271      return $objects;
272  }
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  }
publicturk[ hitassignment_db ]
Code
447  public function get_turk($__type="default")
448  {
449      $object = is_null(keyval($this->property_objects_array,"{$__type}_turk")) ? new turk($this->get_turk_id($__type)) : $this->property_objects_array["{$__type}_turk"];
450      $this->property_objects_array["{$__type}_turk"] = $object;
451      return $object;
452  }
Code
484  public function set_turk($__v, $__type="default")
485  {
486      $object = is_null(keyval($this->property_objects_array,"{$__type}_turk")) ? new turk($this->get_turk_id($__type)) : $this->property_objects_array["{$__type}_turk"];
487      if (is_null($__v))
488      {
489          $rel = new hitassignment_turk(null,$this->id,$object->id,hitassignment_turk::type_id($__type));
490          $rel->delete();
491          if (!is_null(keyval($this->property_objects_array,"{$__type}_turk")))
492          {
493              $this->property_objects_array["{$__type}_turk"] = null;
494          }
495      }
496      else
497      {
498          $id = $object->id;
499          $object = $__v;
500          $object->id = $__v->id>0 ? $__v->id : $id;
501          $object->commit();
502          $this->set_turk_ids(array($object->id),$__type);
503      }
504  }
publicturk_id[ hitassignment_db ]
Code
453  public function get_turk_id($__type="default")
454  {
455      $ids = $this->get_turk_ids($__type, true);
456      return (count($ids)==1 ? $ids[0] : null);
457  }
Code
505  public function set_turk_id($__v, $__type="default")
506  {
507      $this->set_turk_ids(array($__v),$__type);
508  }
publicturk_ids[ hitassignment_db ]
Code
458  public function get_turk_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
459  {
460      $turk_ids = array();
461      $db = hitassignment::db();
462      $q  = " SELECT aws_turk.person_entity_id FROM aws_hitassignment_turk INNER JOIN aws_turk ON aws_hitassignment_turk.turk_person_entity_id=aws_turk.person_entity_id AND aws_hitassignment_turk.deleted=0 AND aws_turk.deleted=0 AND aws_hitassignment_turk.hitassignment_id='$this->id' " . (is_null($__type) ? "" : " AND aws_hitassignment_turk.hitassignment_turk_type_id='" . hitassignment_turk::type_id($__type) . "'") . ($__get_primary ? " AND aws_hitassignment_turk.primary=1 " : "");
463      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
464      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
465      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
466      $db->query($q);
467      while ($db->next_record())
468      {
469          $turk_ids[] = $db->f("person_entity_id");
470      }
471      return $turk_ids;
472  }
Code
509  public function set_turk_ids($__v, $__type="default")
510  {
511      if ($this->id == 0)
512      {
513          $this->commit();
514      }
515      $type_id = hitassignment_turk::type_id($__type);
516      hitassignment_turk::delete_all($this->id,null,$type_id);
517      if (is_array($__v))
518      {
519          foreach ($__v as $index=>$id)
520          {
521              $object = new hitassignment_turk(null,$this->id,$id,$type_id);
522              $object->deleted = false;
523              $object->hitassignment_turk_type_id = $type_id;
524              $object->commit();
525              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_turk")))
526              {
527                  $this->property_objects_array["{$__type}_turk"] = new turk($object->turk_id);
528              }
529          }
530          $this->_dirty = true;
531      }
532  }
publicturk_list[ hitassignment_db ]
Code
473  public function get_turk_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
474  {
475      $ids = $this->get_turk_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
476      $objects = array();
477      foreach ($ids as $index=>$id)
478      {
479          $objects[$index] = new turk($id);
480      }
481      return $objects;
482  }
Code
533  public function set_turk_list($__v, $__type="default")
534  {
535      if (is_array($__v))
536      {
537          $ids = array();
538          foreach ($__v as $index=>$object)
539          {
540              $ids[] = $object->id;
541          }
542          $this->set_turk_ids($ids,$__type);
543      }
544  }
publicworktimeinseconds[ hitassignment_ext ]
Code
026  public function get_worktimeinseconds()
027  {
028      return strtotime($this->submit_hitassignmentdate->value)-strtotime($this->accept_hitassignmentdate->value);
029  }
Get Helix PHP Framework at SourceForge.net. Fast, secure and Free Open Source software downloads