Helix Installation   Getting Started   Reference Documentation   Global Functions   Quick Start
ModulesClassesFunctions
 

Class Reference

class workflow extends workflow_ext

Hide Inherited MembersWorkflow Management
Description
No description.
 
Constants
constantTABLENAME ["wfm_workflow"][ workflow ]
 
Properties
protected_cdate[ workflow_db ]
protected_cdate_dirty[ workflow_db ]
protected_deleted[ workflow_db ]
protected_deleted_dirty[ workflow_db ]
protected_description[ workflow_db ]
protected_description_dirty[ workflow_db ]
protected_dirty[ obj ]
protected_id[ workflow_db ]
protected_id_dirty[ workflow_db ]
protected_mdate[ workflow_db ]
protected_mdate_dirty[ workflow_db ]
protected_name[ workflow_db ]
protected_name_dirty[ workflow_db ]
publicproperty_objects_array[ obj ]
protected_sequence[ workflow_db ]
protected_sequence_dirty[ workflow_db ]
protected_workflow_type_id[ workflow_db ]
protected_workflow_type_id_dirty[ workflow_db ]
 
Methods
publiccommit ( )[ workflow_db ]
Parameters
No parameters for this method
Code
104  public function commit()
105  {
106      if ($this->_id > 0)
107      {
108          $this->update();
109      }
110      else
111      {
112          $this->insert();
113      }
114 
115      foreach ($this->property_objects_array as $property=>$object)
116      {
117          $this->{$property} = $object;
118      }
119 
120      return true;
121  }
public__construct ( id )[ workflow_db ]
Parameters
optionalid
Code
046  public function __construct($__id=null)
047  {
048      $this->_id = 0;
049      $this->_name = "";
050      $this->_description = "";
051      $this->_sequence = 0;
052      $this->_workflow_type_id = 0;
053      $this->_mdate = null;
054      $this->_cdate = null;
055      $this->_deleted = false;
056 
057      $this->_id_dirty = false;
058      $this->_name_dirty = false;
059      $this->_description_dirty = false;
060      $this->_sequence_dirty = false;
061      $this->_workflow_type_id_dirty = false;
062      $this->_mdate_dirty = false;
063      $this->_cdate_dirty = false;
064      $this->_deleted_dirty = false;
065 
066      if (is_null($__id))
067      {
068          return;
069      }
070 
071      $db = workflow::db();
072      $q  = " SELECT wfm_workflow.id,wfm_workflow.name,wfm_workflow.description,wfm_workflow.sequence,wfm_workflow.workflow_type_id,wfm_workflow.mdate,wfm_workflow.cdate,wfm_workflow.deleted ";
073      $q .= " FROM wfm_workflow ";       
074      if (!is_null($__id))
075      {
076          $q .= " WHERE id = '$__id' ";
077      }
078 
079      $db->query($q);
080      if ($db->next_record() && $db->num_rows() == 1)
081      {
082          $this->_id = $db->f("id");
083          $this->_name = $db->f("name");
084          $this->_description = $db->f("description");
085          $this->_sequence = $db->f("sequence");
086          $this->_workflow_type_id = $db->f("workflow_type_id");
087          $this->_mdate = $db->f("mdate");
088          $this->_cdate = $db->f("cdate");
089          $this->_deleted = $db->f("deleted");
090      }
091  }
protected staticdb ( )[ workflow_db ]
Parameters
No parameters for this method
Code
461  protected static function db()
462  {
463      return new db();
464  }
publicdelete ( )[ workflow_db ]
Parameters
No parameters for this method
Code
163  public function delete()
164  {
165      $db = workflow::db();
166      $q  = " UPDATE wfm_workflow SET ";
167      $q .= " deleted = 1 ";
168      $q .= " WHERE id = " . $this->_id;
169      $db->query($q);
170      $this->deleted = true;
171      return true;
172  }
public staticdelete_all ( )[ workflow_db ]
Parameters
No parameters for this method
Code
270  public static function delete_all()
271  {
272      $db = workflow::db();
273      $q  = " UPDATE wfm_workflow SET ";
274      $q .= " deleted = 1 ";
275     
276      $db->query($q);
277      return true;
278  }
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] )[ workflow_db ]
Parameters
requiredcolumns
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
194  public static function get_columns($__columns, $__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
195  {
196      $lookups = is_array($__lookups) ? $__lookups : array($__lookups);
197      $colarray = is_array($__columns) ? $__columns : explode(",",$__columns);
198      $colstring = is_array($__columns) ? implode(",",$__columns) : $__columns;
199 
200      $db = workflow::db();
201      $data = array();
202      $q  = " SELECT $colstring ";
203      $q .= " FROM wfm_workflow ";
204      $q .= " WHERE wfm_workflow.deleted = 0 ";
205      $q .= is_null($__where_clause) ? null : " AND ($__where_clause) ";
206      $q .= array_key_exists("workflow_type_id",$lookups) ? " AND wfm_workflow.workflow_type_id='" . $lookups["workflow_type_id"] . "' " : "";
207 
208      if (is_string($__order))
209      {
210          $q .= "ORDER BY " . $__order;
211      }
212      else if (is_array($__order) and count($__order)>0)
213      {
214          $orderings = array();
215          foreach ($__order as $col=>$dir)
216          {
217              $orderings[] = " $col $dir ";
218          }
219          $q .= "ORDER BY " . implode(", ", $orderings);
220      }
221      else if (is_object($__order))
222      {
223          $q .= "";
224      }
225      else
226      {
227          // THERE IS NO `order` COLUMN ON THIS OBJECT
228      }
229 
230      if (!is_null($__limit))
231      {
232          $q .= " LIMIT $__offset , $__limit ";
233      }
234 
235      $db->query($q);
236 
237      if (count($colarray)>1 || $colstring=="*")
238      {
239          while ($db->next_record())
240          {
241              $data[] = $db->record;
242          }
243      }
244      else
245      {
246          while ($db->next_record())
247          {
248              $data[] = $db->f(0);
249          }
250      }
251 
252      return $data;
253  }
publicget_dirty ( )[ obj ]
Parameters
No parameters for this method
Code
063  public function get_dirty()
064  {
065      if ($this->id === 0)
066      {
067          $this->_dirty = true;
068      }
069      else
070      {
071          foreach (get_object_vars($this) as $k=>$v)
072          {
073              if ($this->_dirty)
074              {
075                  break;
076              }
077              if (preg_match('/_dirty$/',$k))
078              {
079                  $this->_dirty = $this->_dirty || $v;
080              }
081          }
082      }
083      return $this->_dirty;
084  }
public staticget_ids ( order , lookups , where_clause , limit , offset [0] )[ workflow_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
255  public static function get_ids($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
256  {
257      return workflow::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset);
258  }
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] )[ workflow_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
260  public static function get_objects($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
261  {
262      $objects = array();
263      foreach (workflow::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset) as $id)
264      {
265          $objects[] = new workflow($id);
266      }
267      return $objects;
268  }
publicget_process ( type ["default"] )[ workflow_db ]
Parameters
optionaltype ["default"]
Code
362  public function get_process($__type="default")
363  {
364      $object = is_null(keyval($this->property_objects_array,"{$__type}_process")) ? new process($this->get_process_id($__type)) : $this->property_objects_array["{$__type}_process"];
365      $this->property_objects_array["{$__type}_process"] = $object;
366      return $object;
367  }
publicget_process_id ( type ["default"] )[ workflow_db ]
Parameters
optionaltype ["default"]
Code
368  public function get_process_id($__type="default")
369  {
370      $ids = $this->get_process_ids($__type, true);
371      return (count($ids)==1 ? $ids[0] : null);
372  }
publicget_process_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ workflow_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
373  public function get_process_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
374  {
375      $process_ids = array();
376      $db = workflow::db();
377      $q  = " SELECT wfm_process.id FROM wfm_process_workflow INNER JOIN wfm_process ON wfm_process_workflow.process_id=wfm_process.id AND wfm_process_workflow.deleted=0 AND wfm_process.deleted=0 AND wfm_process_workflow.workflow_id='$this->id' " . (is_null($__type) ? "" : " AND wfm_process_workflow.process_workflow_type_id='" . process_workflow::type_id($__type) . "'") . ($__get_primary ? " AND wfm_process_workflow.primary=1 " : "");
378      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
379      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
380      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
381      $db->query($q);
382      while ($db->next_record())
383      {
384          $process_ids[] = $db->f("id");
385      }
386      return $process_ids;
387  }
publicget_process_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ workflow_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
388  public function get_process_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
389  {
390      $ids = $this->get_process_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
391      $objects = array();
392      foreach ($ids as $index=>$id)
393      {
394          $objects[$index] = new process($id);
395      }
396      return $objects;
397  }
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_type ( )[ workflow_db ]
Parameters
No parameters for this method
Code
339  public function get_type()
340  {
341      $type = new workflow_type($this->_workflow_type_id);
342      return $type->name;
343  }
publicget_workflow_type ( )[ workflow_db ]
Parameters
No parameters for this method
Code
350  public function get_workflow_type()
351  {
352      return new workflow_type($this->workflow_type_id);
353  }
protectedinsert ( )[ workflow_db ]
Parameters
No parameters for this method
Code
123  protected function insert()
124  {
125      $db = workflow::db();
126      $q  = " INSERT INTO wfm_workflow ( ";
127      $q .= $db->param_string("name") . ", ";
128      $q .= $db->param_string("description") . ", ";
129      $q .= $db->param_string("sequence") . ", ";
130      $q .= $db->param_string("workflow_type_id") . ", ";
131      $q .= $db->param_string("mdate") . ", ";
132      $q .= $db->param_string("cdate") . ", ";
133      $q .= $db->param_string("deleted");
134      $q .= " ) VALUES ( ";
135      $q .= $db->value_string($this->_name) . ", ";
136      $q .= $db->value_string($this->_description) . ", ";
137      $q .= $db->value_string($this->_sequence) . ", ";
138      $q .= $db->value_string($this->_workflow_type_id) . ", ";
139      $q .= $db->value_string(timestamp()) . ", ";
140      $q .= $db->value_string(timestamp()) . ", ";
141      $q .= $this->deleted ? "'1'" : "'0'";
142      $q .= " ) ";
143      $db->query($q);
144      $this->_id = $db->insert_id;
145      return true;
146  }
publicmap ( )[ workflow_db ]
Parameters
No parameters for this method
Code
093  public function map()
094  {
095      $this->_name = array_key_exists("workflow:name",$_REQUEST) ? reqval("workflow:name") : $this->_name;
096      $this->_description = array_key_exists("workflow:description",$_REQUEST) ? reqval("workflow:description") : $this->_description;
097      $this->_sequence = array_key_exists("workflow:sequence",$_REQUEST) ? reqval("workflow:sequence") : $this->_sequence;
098      $this->_workflow_type_id = array_key_exists("workflow:workflow_type_id",$_REQUEST) ? reqval("workflow:workflow_type_id") : $this->_workflow_type_id;
099      $this->_mdate = array_key_exists("workflow:mdate",$_REQUEST) ? reqval("workflow:mdate") : $this->_mdate;
100      $this->_cdate = array_key_exists("workflow:cdate",$_REQUEST) ? reqval("workflow:cdate") : $this->_cdate;
101      $this->_deleted = array_key_exists("workflow:deleted",$_REQUEST) ? reqval("workflow:deleted") : $this->_deleted;
102  }
publicpurge ( )[ workflow_db ]
Parameters
No parameters for this method
Code
185  public function purge()
186  {
187      $db = workflow::db();
188      $q  = " DELETE FROM wfm_workflow ";
189      $q .= " WHERE id = " . $this->_id;
190      $db->query($q);
191      return true;
192  }
public staticsearch ( keyword )[ workflow_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_process ( v , type ["default"] )[ workflow_db ]
Parameters
requiredv
optionaltype ["default"]
Code
399  public function set_process($__v, $__type="default")
400  {
401      $object = is_null(keyval($this->property_objects_array,"{$__type}_process")) ? new process($this->get_process_id($__type)) : $this->property_objects_array["{$__type}_process"];
402      if (is_null($__v))
403      {
404          $rel = new process_workflow(null,$object->id,$this->id,process_workflow::type_id($__type));
405          $rel->delete();
406          if (!is_null(keyval($this->property_objects_array,"{$__type}_process")))
407          {
408              $this->property_objects_array["{$__type}_process"] = null;
409          }
410      }
411      else
412      {
413          $id = $object->id;
414          $object = $__v;
415          $object->id = $__v->id>0 ? $__v->id : $id;
416          $object->commit();
417          $this->set_process_ids(array($object->id),$__type);
418      }
419  }
publicset_process_id ( v , type ["default"] )[ workflow_db ]
Parameters
requiredv
optionaltype ["default"]
Code
420  public function set_process_id($__v, $__type="default")
421  {
422      $this->set_process_ids(array($__v),$__type);
423  }
publicset_process_ids ( v , type ["default"] )[ workflow_db ]
Parameters
requiredv
optionaltype ["default"]
Code
424  public function set_process_ids($__v, $__type="default")
425  {
426      if ($this->id == 0)
427      {
428          $this->commit();
429      }
430      $type_id = process_workflow::type_id($__type);
431      process_workflow::delete_all(null,$this->id,$type_id);
432      if (is_array($__v))
433      {
434          foreach ($__v as $index=>$id)
435          {
436              $object = new process_workflow(null,$id,$this->id,$type_id);
437              $object->deleted = false;
438              $object->process_workflow_type_id = $type_id;
439              $object->commit();
440              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_process")))
441              {
442                  $this->property_objects_array["{$__type}_process"] = new process($object->process_id);
443              }
444          }
445          $this->_dirty = true;
446      }
447  }
publicset_process_list ( v , type ["default"] )[ workflow_db ]
Parameters
requiredv
optionaltype ["default"]
Code
448  public function set_process_list($__v, $__type="default")
449  {
450      if (is_array($__v))
451      {
452          $ids = array();
453          foreach ($__v as $index=>$object)
454          {
455              $ids[] = $object->id;
456          }
457          $this->set_process_ids($ids,$__type);
458      }
459  }
publicset_type ( v )[ workflow_db ]
Parameters
requiredv
Code
344  public function set_type($v)
345  {
346      $type = new workflow_type(null, $v);
347      $this->workflow_type_id = $type->id;
348  }
publicset_workflow_type ( v )[ workflow_db ]
Parameters
requiredv
Code
354  public function set_workflow_type($v)
355  {
356      if ($v->id > 0)
357      {
358          $this->workflow_type_id = $v->id;
359      }
360  }
public__toString ( )[ workflow_db ]
Parameters
No parameters for this method
Code
328  public function __toString()
329  {
330      return (is_null($this->name) ? "" : $this->name);
331  }
public statictype_id ( type_name )[ workflow_db ]
Parameters
requiredtype_name
Code
333  public static function type_id($__type_name)
334  {
335      $type = new workflow_type(null, $__type_name);
336      return $type->id;
337  }
publicundelete ( )[ workflow_db ]
Parameters
No parameters for this method
Code
174  public function undelete()
175  {
176      $db = workflow::db();
177      $q  = " UPDATE wfm_workflow SET ";
178      $q .= " deleted = 0 ";
179      $q .= " WHERE id = " . $this->_id;
180      $db->query($q);
181      $this->deleted = false;
182      return true;
183  }
protectedupdate ( )[ workflow_db ]
Parameters
No parameters for this method
Code
148  protected function update()
149  {
150      $db = workflow::db();
151      $q  = " UPDATE wfm_workflow SET ";
152      $q .= $db->param_string("name") . " = " . $db->value_string($this->_name) . ", ";
153      $q .= $db->param_string("description") . " = " . $db->value_string($this->_description) . ", ";
154      $q .= $db->param_string("sequence") . " = " . $db->value_string($this->_sequence) . ", ";
155      $q .= $db->param_string("workflow_type_id") . " = " . $db->value_string($this->_workflow_type_id) . ", ";
156      $q .= $db->param_string("mdate") . " = " . $db->value_string(timestamp()) . ", ";
157      $q .= $db->param_string("deleted") . " = " . ($this->deleted ? "'1'" : "'0'");
158      $q .= " WHERE id = " . $this->_id;
159      $db->query($q);
160      return true;
161  }
 
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[ workflow_db ]
Code
194  public static function get_columns($__columns, $__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
195  {
196      $lookups = is_array($__lookups) ? $__lookups : array($__lookups);
197      $colarray = is_array($__columns) ? $__columns : explode(",",$__columns);
198      $colstring = is_array($__columns) ? implode(",",$__columns) : $__columns;
199 
200      $db = workflow::db();
201      $data = array();
202      $q  = " SELECT $colstring ";
203      $q .= " FROM wfm_workflow ";
204      $q .= " WHERE wfm_workflow.deleted = 0 ";
205      $q .= is_null($__where_clause) ? null : " AND ($__where_clause) ";
206      $q .= array_key_exists("workflow_type_id",$lookups) ? " AND wfm_workflow.workflow_type_id='" . $lookups["workflow_type_id"] . "' " : "";
207 
208      if (is_string($__order))
209      {
210          $q .= "ORDER BY " . $__order;
211      }
212      else if (is_array($__order) and count($__order)>0)
213      {
214          $orderings = array();
215          foreach ($__order as $col=>$dir)
216          {
217              $orderings[] = " $col $dir ";
218          }
219          $q .= "ORDER BY " . implode(", ", $orderings);
220      }
221      else if (is_object($__order))
222      {
223          $q .= "";
224      }
225      else
226      {
227          // THERE IS NO `order` COLUMN ON THIS OBJECT
228      }
229 
230      if (!is_null($__limit))
231      {
232          $q .= " LIMIT $__offset , $__limit ";
233      }
234 
235      $db->query($q);
236 
237      if (count($colarray)>1 || $colstring=="*")
238      {
239          while ($db->next_record())
240          {
241              $data[] = $db->record;
242          }
243      }
244      else
245      {
246          while ($db->next_record())
247          {
248              $data[] = $db->f(0);
249          }
250      }
251 
252      return $data;
253  }
publicdirty[ obj ]
Code
063  public function get_dirty()
064  {
065      if ($this->id === 0)
066      {
067          $this->_dirty = true;
068      }
069      else
070      {
071          foreach (get_object_vars($this) as $k=>$v)
072          {
073              if ($this->_dirty)
074              {
075                  break;
076              }
077              if (preg_match('/_dirty$/',$k))
078              {
079                  $this->_dirty = $this->_dirty || $v;
080              }
081          }
082      }
083      return $this->_dirty;
084  }
publicids[ workflow_db ]
Code
255  public static function get_ids($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
256  {
257      return workflow::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset);
258  }
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[ workflow_db ]
Code
260  public static function get_objects($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
261  {
262      $objects = array();
263      foreach (workflow::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset) as $id)
264      {
265          $objects[] = new workflow($id);
266      }
267      return $objects;
268  }
publicprocess[ workflow_db ]
Code
362  public function get_process($__type="default")
363  {
364      $object = is_null(keyval($this->property_objects_array,"{$__type}_process")) ? new process($this->get_process_id($__type)) : $this->property_objects_array["{$__type}_process"];
365      $this->property_objects_array["{$__type}_process"] = $object;
366      return $object;
367  }
Code
399  public function set_process($__v, $__type="default")
400  {
401      $object = is_null(keyval($this->property_objects_array,"{$__type}_process")) ? new process($this->get_process_id($__type)) : $this->property_objects_array["{$__type}_process"];
402      if (is_null($__v))
403      {
404          $rel = new process_workflow(null,$object->id,$this->id,process_workflow::type_id($__type));
405          $rel->delete();
406          if (!is_null(keyval($this->property_objects_array,"{$__type}_process")))
407          {
408              $this->property_objects_array["{$__type}_process"] = null;
409          }
410      }
411      else
412      {
413          $id = $object->id;
414          $object = $__v;
415          $object->id = $__v->id>0 ? $__v->id : $id;
416          $object->commit();
417          $this->set_process_ids(array($object->id),$__type);
418      }
419  }
publicprocess_id[ workflow_db ]
Code
368  public function get_process_id($__type="default")
369  {
370      $ids = $this->get_process_ids($__type, true);
371      return (count($ids)==1 ? $ids[0] : null);
372  }
Code
420  public function set_process_id($__v, $__type="default")
421  {
422      $this->set_process_ids(array($__v),$__type);
423  }
publicprocess_ids[ workflow_db ]
Code
373  public function get_process_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
374  {
375      $process_ids = array();
376      $db = workflow::db();
377      $q  = " SELECT wfm_process.id FROM wfm_process_workflow INNER JOIN wfm_process ON wfm_process_workflow.process_id=wfm_process.id AND wfm_process_workflow.deleted=0 AND wfm_process.deleted=0 AND wfm_process_workflow.workflow_id='$this->id' " . (is_null($__type) ? "" : " AND wfm_process_workflow.process_workflow_type_id='" . process_workflow::type_id($__type) . "'") . ($__get_primary ? " AND wfm_process_workflow.primary=1 " : "");
378      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
379      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
380      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
381      $db->query($q);
382      while ($db->next_record())
383      {
384          $process_ids[] = $db->f("id");
385      }
386      return $process_ids;
387  }
Code
424  public function set_process_ids($__v, $__type="default")
425  {
426      if ($this->id == 0)
427      {
428          $this->commit();
429      }
430      $type_id = process_workflow::type_id($__type);
431      process_workflow::delete_all(null,$this->id,$type_id);
432      if (is_array($__v))
433      {
434          foreach ($__v as $index=>$id)
435          {
436              $object = new process_workflow(null,$id,$this->id,$type_id);
437              $object->deleted = false;
438              $object->process_workflow_type_id = $type_id;
439              $object->commit();
440              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_process")))
441              {
442                  $this->property_objects_array["{$__type}_process"] = new process($object->process_id);
443              }
444          }
445          $this->_dirty = true;
446      }
447  }
publicprocess_list[ workflow_db ]
Code
388  public function get_process_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
389  {
390      $ids = $this->get_process_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
391      $objects = array();
392      foreach ($ids as $index=>$id)
393      {
394          $objects[$index] = new process($id);
395      }
396      return $objects;
397  }
Code
448  public function set_process_list($__v, $__type="default")
449  {
450      if (is_array($__v))
451      {
452          $ids = array();
453          foreach ($__v as $index=>$object)
454          {
455              $ids[] = $object->id;
456          }
457          $this->set_process_ids($ids,$__type);
458      }
459  }
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  }
publictype[ workflow_db ]
Code
339  public function get_type()
340  {
341      $type = new workflow_type($this->_workflow_type_id);
342      return $type->name;
343  }
Code
344  public function set_type($v)
345  {
346      $type = new workflow_type(null, $v);
347      $this->workflow_type_id = $type->id;
348  }
publicworkflow_type[ workflow_db ]
Code
350  public function get_workflow_type()
351  {
352      return new workflow_type($this->workflow_type_id);
353  }
Code
354  public function set_workflow_type($v)
355  {
356      if ($v->id > 0)
357      {
358          $this->workflow_type_id = $v->id;
359      }
360  }
Get Helix PHP Framework at SourceForge.net. Fast, secure and Free Open Source software downloads