fogproject  1.5.9
About: FOG is a Linux-based network computer cloning solution for Windows, Mac OSX and various Linux distributions that ties together a few open-source tools with a PHP-based web interface. FOG doesn’t use any boot disks, or CDs; everything is done via TFTP and PXE.
  Fossies Dox: fogproject-1.5.9.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

fogcontroller.class.php
Go to the documentation of this file.
1 <?php
28 abstract class FOGController extends FOGBase
29 {
35  protected $data = array();
41  protected $autoSave = false;
47  protected $databaseTable = '';
53  protected $databaseFields = array();
59  protected $databaseFieldsRequired = array();
65  protected $additionalFields = array();
72  protected $databaseFieldsFlipped = array();
78  protected $databaseFieldsToIgnore = array(
79  'createdBy',
80  'createdTime',
81  );
87  protected $aliasedFields = array();
93  protected $databaseFieldClassRelationships = array();
99  protected $loadQueryTemplate = 'SELECT %s FROM `%s` %s WHERE `%s`=%s %s';
105  protected $insertQueryTemplate = 'INSERT INTO `%s` (%s) VALUES (%s) %s %s';
111  protected $destroyQueryTemplate = 'DELETE FROM `%s` WHERE %s=%s%s';
121  public function __construct($data = '')
122  {
123  parent::__construct();
124  $this->databaseTable = trim($this->databaseTable);
125  $this->databaseFields = array_unique($this->databaseFields);
126  $this->databaseFields = array_filter($this->databaseFields);
127  try {
128  if (!isset($this->databaseTable)) {
129  throw new Exception(_('Table not defined for this class'));
130  }
131  if (!count($this->databaseFields)) {
132  throw new Exception(_('Fields not defined for this class'));
133  }
134  $this->databaseFieldsFlipped = array_flip($this->databaseFields);
135  if (is_numeric($data) && $data > 0) {
136  $this->set('id', $data)->load();
137  } elseif (is_numeric($data)) {
138  $this->set('id', $data);
139  } elseif (is_array($data)) {
140  $this->setQuery($data);
141  }
142  } catch (Exception $e) {
143  $str = sprintf(
144  '%s, %s: %s',
145  _('Record not found'),
146  _('Error'),
147  $e->getMessage()
148  );
149  self::error($str);
150  }
151 
152  return $this;
153  }
159  public function __destruct()
160  {
161  if ($this->autoSave) {
162  $this->save();
163  }
164 
165  return false;
166  }
172  public function __toString()
173  {
174  $str = sprintf('%s ID: %s', get_class($this), $this->get('id'));
175  if ($this->get('name')) {
176  $str = sprintf('%s %s: %s', $str, _('Name'), $this->get('name'));
177  }
178 
179  return $str;
180  }
188  private function _testFields($key)
189  {
190  $this->key($key);
191  $inFields = array_key_exists($key, $this->databaseFields);
192  $inFieldsFlipped = array_key_exists($key, $this->databaseFieldsFlipped);
193  $inAddFields = in_array($key, $this->additionalFields);
194  if (!$inFields && !$inFieldsFlipped && !$inAddFields) {
195  return false;
196  }
197 
198  return true;
199  }
207  public function get($key = '')
208  {
209  $key = $this->key($key);
210  if (!$key) {
211  return $this->data;
212  }
213  $test = $this->_testFields($key);
214  if (!$test) {
215  return false;
216  }
217  if (!$this->isLoaded($key)) {
218  $this->loadItem($key);
219  }
220  $msg = sprintf(
221  '%s: %s, %s: %s',
222  _('Returning value of key'),
223  $key,
224  _('Value'),
225  print_r(isset($this->data[$key]) ? $this->data[$key] : 'null', 1)
226  );
227  self::info($msg);
228 
229  return isset($this->data[$key]) ? $this->data[$key] : null;
230  }
241  public function set($key, $value)
242  {
243  try {
244  $key = $this->key($key);
245  if (!$key) {
246  throw new Exception(_('No key being requested'));
247  }
248  $test = $this->_testFields($key);
249  if (!$test) {
250  throw new Exception(_('Invalid key being set'));
251  }
252  if (!$this->isLoaded($key)) {
253  $this->loadItem($key);
254  }
255  $msg = sprintf(
256  '%s: %s, $s: %s',
257  _('Setting Key'),
258  $key,
259  _('Value'),
260  print_r($value, 1)
261  );
262  self::info($msg);
263  $this->data[$key] = $value;
264  } catch (Exception $e) {
265  $str = sprintf(
266  '%s: %s: %s, %s: %s',
267  _('Set failed'),
268  _('Key'),
269  $key,
270  _('Error'),
271  $e->getMessage()
272  );
273  self::debug($str);
274  }
275 
276  return $this;
277  }
288  public function add($key, $value)
289  {
290  try {
291  $key = $this->key($key);
292  if (!$key) {
293  throw new Exception(_('No key being requested'));
294  }
295  $test = $this->_testFields($key);
296  if (!$test) {
297  throw new Exception(_('Invalid key being added'));
298  }
299  if (!$this->isLoaded($key)) {
300  $this->loadItem($key);
301  }
302  $msg = sprintf(
303  '%s: %s, %s: %s',
304  _('Adding Key'),
305  $key,
306  _('Value'),
307  print_r($value, 1)
308  );
309  self::info($msg);
310  if (isset($this->data[$key]) && !is_array($this->data[$key])) {
311  $this->data[$key] = array($this->data[$key]);
312  }
313  $this->data[$key][] = $value;
314  } catch (Exception $e) {
315  $str = sprintf(
316  '%s: %s: %s, %s: %s',
317  _('Add failed'),
318  _('Key'),
319  $key,
320  _('Error'),
321  $e->getMessage()
322  );
323  self::debug($str);
324  }
325 
326  return $this;
327  }
338  public function remove($key, $value)
339  {
340  try {
341  $key = $this->key($key);
342  if (!$key) {
343  throw new Exception(_('No key being requested'));
344  }
345  $test = $this->_testFields($key);
346  if (!$test) {
347  throw new Exception(_('Invalid key being removed'));
348  }
349  if (!$this->isLoaded($key)) {
350  $this->loadItem($key);
351  }
352  if (!is_array($this->data[$key])) {
353  $this->data[$key] = (array)$this->data[$key];
354  }
355  $ind = array_search($value, $this->data[$key]);
356  if (false !== $ind) {
357  $msg = sprintf(
358  '%s: %s, %s: %s',
359  _('Removing Key'),
360  $key,
361  _('Value'),
362  print_r($this->data[$key][$ind], 1)
363  );
364  self::info($msg);
365  unset($this->data[$key][$ind]);
366  }
367  $this->data[$key] = array_values(array_filter($this->data[$key]));
368  } catch (Exception $e) {
369  $str = sprintf(
370  '%s: %s: %s, %s: %s',
371  _('Remove failed'),
372  _('Key'),
373  $key,
374  _('Error'),
375  $e->getMessage()
376  );
377  self::debug($str);
378  }
379 
380  return $this;
381  }
387  public function save()
388  {
389  try {
390  $insertKeys = array();
391  $insertValKeys = $updateValKeys = array();
392  $insertValues = $updateValues = array();
393  $updateData = $fieldData = array();
394  if (count($this->aliasedFields) > 0) {
395  self::arrayRemove($this->aliasedFields, $this->databaseFields);
396  }
397  foreach ($this->databaseFields as $key => &$column) {
398  $key = $this->key($key);
399  $column = trim($column);
400  $eColumn = sprintf('`%s`', $column);
401  $paramInsert = sprintf(':%s_insert', $column);
402  $val = $this->get($key);
403  switch ($key) {
404  case 'createdBy':
405  if (!$val) {
406  if (self::$FOGUser->isValid()) {
407  $val = trim(self::$FOGUser->get('name'));
408  } else {
409  $val = 'fog';
410  }
411  }
412  break;
413  case 'createdTime':
414  if (!($val && self::validDate($val))) {
415  $val = self::formatTime('now', 'Y-m-d H:i:s');
416  }
417  break;
418  case 'id':
419  if (!(is_numeric($val) && $val > 0)) {
420  continue 2;
421  }
422  break;
423  }
424  if (is_null($val)) {
425  $val = '';
426  }
427  $insertKeys[] = $eColumn;
428  $insertValKeys[] = $paramInsert;
429  $insertValues[] = $val;
430  $updateData[] = sprintf(
431  '%s=VALUES(%s)',
432  $eColumn,
433  $eColumn
434  );
435  unset(
436  $column,
437  $eColumn,
438  $key,
439  $val
440  );
441  }
442  $query = sprintf(
443  $this->insertQueryTemplate,
444  $this->databaseTable,
445  implode(',', (array) $insertKeys),
446  implode(',', (array) $insertValKeys),
447  'ON DUPLICATE KEY UPDATE',
448  implode(',', (array) $updateData)
449  );
450  $queryArray = array_combine(
451  $insertValKeys,
452  $insertValues
453  );
454  $msg = sprintf(
455  '%s %s %s',
456  _('Saving data for'),
457  get_class($this),
458  _('object')
459  );
460  self::info($msg);
461  self::$DB->query($query, array(), $queryArray);
462  if (!$this->get('id') || $this->get('id') < 1) {
463  $this->set('id', self::$DB->insertId());
464  }
465  if (!$this instanceof History) {
466  if ($this->get('name')) {
467  $msg = sprintf(
468  '%s %s: %s %s: %s %s.',
469  get_class($this),
470  _('ID'),
471  $this->get('id'),
472  _('NAME'),
473  $this->get('name'),
474  _('has been successfully updated')
475  );
476  } else {
477  $msg = sprintf(
478  '%s %s: %s %s.',
479  get_class($this),
480  _('ID'),
481  $this->get('id'),
482  _('has been successfully updated')
483  );
484  }
486  }
487  } catch (Exception $e) {
488  if (!$this instanceof History) {
489  if ($this->get('name')) {
490  $msg = sprintf(
491  '%s %s: %s %s: %s %s. %s: %s',
492  get_class($this),
493  _('ID'),
494  $this->get('id'),
495  _('Name'),
496  $this->get('name'),
497  _('has failed to save'),
498  _('Error'),
499  $e->getMessage()
500  );
501  } else {
502  $msg = sprintf(
503  '%s %s: %s %s. %s: %s',
504  get_class($this),
505  _('ID'),
506  $this->get('id'),
507  _('has failed to save'),
508  _('Error'),
509  $e->getMessage()
510  );
511  }
513  }
514  $msg = sprintf(
515  '%s: %s: %s, %s: %s',
516  _('Database save failed'),
517  _('ID'),
518  $this->get('id'),
519  _('Error'),
520  $e->getMessage()
521  );
522  self::debug($msg);
523 
524  return false;
525  }
526 
527  return $this;
528  }
538  public function load($key = 'id')
539  {
540  try {
541  if (!is_string($key)) {
542  throw new Exception(_('Key field must be a string'));
543  }
544  if (!$key) {
545  throw new Exception(_('No key being requested'));
546  }
547  $test = $this->_testFields($key);
548  if (!$test) {
549  throw new Exception(_('Invalid key being added'));
550  }
551  $val = $this->get($key);
552  if (!$val) {
553  throw new Exception(
554  sprintf(
555  '%s: %s',
556  _('Operation field not set'),
557  $key
558  )
559  );
560  }
561  $join = $whereArrayAnd = array();
562  $c = null;
563  $this->buildQuery($join, $whereArrayAnd, $c);
564  $join = array_filter((array) $join);
565  $join = implode((array) $join);
566  $fields = array();
567  $this->getcolumns($fields);
568  $key = $this->key($key);
569  $paramKey = sprintf(':%s', $key);
570  $query = sprintf(
571  $this->loadQueryTemplate,
572  implode(',', $fields),
573  $this->databaseTable,
574  $join,
575  $this->databaseFields[$key],
576  $paramKey,
577  (
578  count($whereArrayAnd) ?
579  sprintf(
580  ' AND %s',
581  implode(' AND ', $whereArrayAnd)
582  ) :
583  ''
584  )
585  );
586  $msg = sprintf(
587  '%s %s',
588  _('Loading data to field'),
589  $key
590  );
591  self::info($msg);
592  $queryArray = array_combine(
593  (array) $paramKey,
594  (array) $val
595  );
596  self::$DB->query(
597  $query,
598  array(),
599  $queryArray
600  );
601  $vals = self::$DB->fetch()->get();
602  $this->setQuery($vals);
603  } catch (Exception $e) {
604  $str = sprintf(
605  '%s: %s: %s, %s: %s',
606  _('Load failed'),
607  _('Key'),
608  $key,
609  _('Error'),
610  $e->getMessage()
611  );
612  self::debug($str);
613  }
614 
615  return $this;
616  }
624  public function getcolumns(&$fields)
625  {
632  $getFields = function (&$column, $k) use (&$fields, &$table) {
633  $column = trim($column);
634  $fields[] = sprintf('`%s`.*', $table);
635  unset($column, $k);
636  };
637  $table = $this->databaseTable;
638  if (count($this->databaseFields) > 0) {
639  array_walk($this->databaseFields, $getFields);
640  }
641  foreach ((array)$this->databaseFieldClassRelationships as $class => &$arr) {
642  self::getClass($class)->getcolumns($fields);
643  unset($arr);
644  }
645  $fields = array_unique($fields);
646  }
656  public function destroy($key = 'id')
657  {
658  try {
659  if (empty($key)) {
660  $key = 'id';
661  }
662  $key = $this->key($key);
663  if (!$key) {
664  throw new Exception(_('No key being requested'));
665  }
666  $test = $this->_testFields($key);
667  if (!$test) {
668  throw new Exception(_('Invalid key being destroyed'));
669  }
670  $val = $this->get($key);
671  if (!is_numeric($val) && !$val) {
672  throw new Exception(
673  sprintf(
674  '%s: %s',
675  _('Operation field not set'),
676  $key
677  )
678  );
679  }
680  $column = $this->databaseFields[$key];
681  $eColumn = sprintf(
682  '`%s`.`%s`',
683  $this->databaseTable,
684  $column
685  );
686  $paramKey = sprintf(':%s', $column);
687  $query = sprintf(
688  $this->destroyQueryTemplate,
689  $this->databaseTable,
690  $eColumn,
691  $paramKey,
692  ''
693  );
694  $queryArray = array_combine(
695  (array) $paramKey,
696  (array) $val
697  );
698  self::$DB->query($query, array(), $queryArray);
699  if (!$this instanceof History) {
700  if ($this->get('name')) {
701  $msg = sprintf(
702  '%s %s: %s %s: %s %s.',
703  get_class($this),
704  _('ID'),
705  $this->get('id'),
706  _('Name'),
707  $this->get('name'),
708  _('has been successfully destroyed')
709  );
710  } else {
711  $msg = sprintf(
712  '%s %s: %s %s.',
713  get_class($this),
714  _('ID'),
715  $this->get('id'),
716  _('has been successfully destroyed')
717  );
718  }
720  }
721  } catch (Exception $e) {
722  if (!$this instanceof History) {
723  if ($this->get('name')) {
724  $msg = sprintf(
725  '%s %s: %s %s: %s %s. %s: %s',
726  get_class($this),
727  _('ID'),
728  $this->get('id'),
729  _('Name'),
730  $this->get('name'),
731  _('has failed to destroy'),
732  _('Error'),
733  $e->getMessage()
734  );
735  } else {
736  $msg = sprintf(
737  '%s %s: %s %s. %s: %s',
738  get_class($this),
739  _('ID'),
740  $this->get('id'),
741  _('has failed to destroy'),
742  _('Error'),
743  $e->getMessage()
744  );
745  }
747  }
748  $msg = sprintf(
749  '%s: %s: %s, %s: %s',
750  _('Destroy failed'),
751  _('ID'),
752  $this->get('id'),
753  _('Error'),
754  $e->getMessage()
755  );
756  self::debug($msg);
757 
758  return false;
759  }
760 
761  return $this;
762  }
770  public function key(&$key)
771  {
772  $key = trim($key);
773  if (array_key_exists($key, $this->databaseFieldsFlipped)) {
774  $key = $this->databaseFieldsFlipped[$key];
775  }
776 
777  return $key;
778  }
788  protected function loadItem($key)
789  {
790  $key = $this->key($key);
791  if (!$key) {
792  throw new Exception(_('No key being requested'));
793  }
794  $test = $this->_testFields($key);
795  if (!$test) {
796  return $this;
797  }
798  $methodCall = sprintf('load%s', ucfirst($key));
799  if (method_exists($this, $methodCall)) {
800  $this->{$methodCall}();
801  }
802  unset($methodCall);
803 
804  return $this;
805  }
823  protected function addRemItem($key, $array, $array_type)
824  {
825  $key = $this->key($key);
826  if (!$key) {
827  throw new Exception(_('No key being requested'));
828  }
829  $test = $this->_testFields($key);
830  if (!$test) {
831  throw new Exception(_('Invalid key being requested'));
832  }
833  if (!in_array($array_type, array('merge', 'diff'))) {
834  throw new Exception(
835  _('Invalid type, merge to add, diff to remove')
836  );
837  }
838  $array = array_filter($array);
839  if (count($array) < 1) {
840  return $this;
841  }
842  switch ($array_type) {
843  case 'merge':
844  foreach ((array)$array as &$a) {
845  $this->add($key, $a);
846  unset($a);
847  }
848  break;
849  case 'diff':
850  foreach ((array)$array as &$a) {
851  $this->remove($key, $a);
852  unset($a);
853  }
854  break;
855  }
856  return $this;
857  }
865  public function isValid()
866  {
867  try {
868  foreach ($this->databaseFieldsRequired as &$key) {
869  $key = $this->key($key);
870  $val = $this->get($key);
871  if (!is_numeric($val) && !$val) {
872  throw new Exception(self::$foglang['RequiredDB']);
873  }
874  unset($key);
875  }
876  if ($this->get('id') < 1) {
877  throw new Exception(_('Invalid ID passed'));
878  }
879  if (array_key_exists('name', $this->databaseFields)) {
880  $val = trim($this->get('name'));
881  }
882  } catch (Exception $e) {
883  $str = sprintf(
884  '%s: %s: %s',
885  _('Failed'),
886  _('Error'),
887  $e->getMessage()
888  );
889  self::debug($str);
890 
891  return false;
892  }
893 
894  return true;
895  }
907  public function buildQuery(
908  &$join,
909  &$whereArrayAnd,
910  &$c,
911  $not = false,
912  $compare = '='
913  ) {
920  $whereInfo = function (
921  &$value,
922  &$field
923  ) use (
924  &$whereArrayAnd,
925  &$c,
926  $not,
927  $compare
928  ) {
929  if (is_array($value)) {
930  $whereArrayAnd[] = sprintf(
931  "`%s`.`%s` IN ('%s')",
932  $c->databaseTable,
933  $field,
934  implode("','", $value)
935  );
936  } else {
937  if (strpos($value, '%')) {
938  $compare = 'LIKE';
939  }
940  $whereArrayAnd[] = sprintf(
941  "`%s`.`%s` %s '%s'",
942  $c->databaseTable,
943  $c->databaseFields[$field],
944  $compare,
945  $value
946  );
947  }
948  unset($value, $field);
949  };
956  $joinInfo = function (
957  &$fields,
958  &$class
959  ) use (
960  &$join,
961  &$whereArrayAnd,
962  &$c,
963  $whereInfo,
964  $not,
965  $compare
966  ) {
967  $className = strtolower($class);
968  $c = self::getClass($class);
969  if (!array_key_exists($className, $join)) {
970  $join[$className] = sprintf(
971  ' LEFT OUTER JOIN `%s` ON `%s`.`%s`=`%s`.`%s` ',
972  $c->databaseTable,
973  $c->databaseTable,
974  $c->databaseFields[$fields[0]],
975  $this->databaseTable,
976  $this->databaseFields[$fields[1]]
977  );
978  }
979  if (isset($fields[3])) {
980  array_walk($fields[3], $whereInfo);
981  }
982  $c->buildQuery($join, $whereArrayAnd, $c, $not, $compare);
983  unset($class, $fields, $c);
984  };
985  $className = strtolower(get_class($this));
986  if (!array_key_exists($className, $join)) {
987  $join[$className] = false;
988  }
989  if (count($this->databaseFieldClassRelationships) > 0) {
990  array_walk($this->databaseFieldClassRelationships, $joinInfo);
991  }
992  return array(implode((array) $join), $whereArrayAnd);
993  }
1001  public function setQuery(&$queryData)
1002  {
1003  $classData = array_intersect_key(
1004  (array) $queryData,
1005  (array) $this->databaseFieldsFlipped
1006  );
1007  if (count($classData) < 1) {
1008  $classData = array_intersect_key(
1009  (array) $queryData,
1010  (array)$this->databaseFields
1011  );
1012  } else {
1013  foreach ($this->databaseFieldsFlipped as $db_key => &$obj_key) {
1014  self::arrayChangeKey($classData, $db_key, $obj_key);
1015  unset($db_key, $obj_key);
1016  }
1017  }
1018  $this->data = self::fastmerge(
1019  (array) $this->data,
1020  (array) $classData
1021  );
1022  foreach ($this->databaseFieldClassRelationships as $class => &$fields) {
1023  $class = self::getClass($class);
1024  $this->set(
1025  $fields[2],
1026  $class->setQuery($queryData)
1027  );
1028  unset($class, $fields);
1029  }
1030  unset($queryData);
1031 
1032  return $this;
1033  }
1039  public function getManager()
1040  {
1041  $class = sprintf('%sManager', get_class($this));
1042 
1043  return new $class();
1044  }
1055  public function assocSetter($assocItem, $alterItem = '', $implicitCall = false)
1056  {
1057  // Lower our item
1058  $alterItem = strtolower($alterItem ?: $assocItem);
1059  // Getter is pluralized
1060  $plural = "{$alterItem}s";
1061  // Class to call, if implicit leave off association.
1062  $classCall = ($implicitCall ? $assocItem : "{$assocItem}Association");
1063  // Main object and string setters.
1064  $obj = strtolower(get_class($this));
1065  $objstr = "{$obj}ID";
1066  $assocstr = "{$alterItem}ID";
1067 
1068  // Don't work on item that isn't loaded yet.
1069  if (!$this->isLoaded($plural)) {
1070  return $this;
1071  }
1072 
1073  // Get the current items.
1074  $items = $this->get($plural);
1075  Route::ids(
1076  $classCall,
1077  [$objstr => $this->get('id')],
1078  $assocstr
1079  );
1080  $cur = json_decode(Route::getData(), true);
1081 
1082  // Get the items differing between the current and what we have associated.
1083  // Remove the items if there's anything to remove.
1084  $rem = array_diff($cur, $items);
1085  if (count($rem)) {
1087  $classCall,
1088  [
1089  $objstr => $this->get('id'),
1090  $assocstr => $rem,
1091  ]
1092  );
1093  }
1094 
1095  // Setup our insert.
1096  $insert_fields = [
1097  $objstr,
1098  $assocstr
1099  ];
1100  $insert_values = [];
1101  if ($assocstr == 'moduleID') {
1102  $insert_fields[] = 'state';
1103  }
1104  foreach ($items as &$id) {
1105  $insert_val = [
1106  $this->get('id'),
1107  $id
1108  ];
1109  if ($assocstr == 'moduleID') {
1110  $insert_val[] = 1;
1111  }
1112  $insert_values[] = $insert_val;
1113  unset($insert_val, $id);
1114  }
1115  if (count($insert_values ?: []) > 0) {
1116  self::getClass("{$classCall}manager")->insertBatch(
1117  $insert_fields,
1118  $insert_values
1119  );
1120  }
1121 
1122  return $this;
1123  }
1124 }
FOGController\$aliasedFields
$aliasedFields
Definition: fogcontroller.class.php:87
FOGController\buildQuery
buildQuery(&$join, &$whereArrayAnd, &$c, $not=false, $compare='=')
Definition: fogcontroller.class.php:907
FOGController\load
load($key='id')
Definition: fogcontroller.class.php:538
FOGController\__construct
__construct($data='')
Definition: fogcontroller.class.php:121
FOGController\save
save()
Definition: fogcontroller.class.php:387
FOGController\addRemItem
addRemItem($key, $array, $array_type)
Definition: fogcontroller.class.php:823
FOGController\$databaseFieldsRequired
$databaseFieldsRequired
Definition: fogcontroller.class.php:59
FOGController\getcolumns
getcolumns(&$fields)
Definition: fogcontroller.class.php:624
FOGBase\getClass
static getClass($class, $data='', $props=false)
Definition: fogbase.class.php:439
FOGBase\info
static info($txt, $data=array())
Definition: fogbase.class.php:763
FOGBase\fastmerge
static fastmerge($array1)
Definition: fogbase.class.php:2415
FOGController\loadItem
loadItem($key)
Definition: fogcontroller.class.php:788
FOGController\assocSetter
assocSetter($assocItem, $alterItem='', $implicitCall=false)
Definition: fogcontroller.class.php:1055
FOGBase\error
static error($txt, $data=array())
Definition: fogbase.class.php:721
FOGController\$loadQueryTemplate
$loadQueryTemplate
Definition: fogcontroller.class.php:99
$test
$test
Definition: freespace.php:37
FOGController\$databaseFieldClassRelationships
$databaseFieldClassRelationships
Definition: fogcontroller.class.php:93
$items
$items
Definition: boot.php:24
$val
$val
Definition: check_node_exists.php:25
FOGBase\formatTime
static formatTime($time, $format=false, $utc=false)
Definition: fogbase.class.php:1124
FOGBase\arrayRemove
static arrayRemove($key, array &$array)
Definition: fogbase.class.php:913
FOGController\$autoSave
$autoSave
Definition: fogcontroller.class.php:41
FOGController\destroy
destroy($key='id')
Definition: fogcontroller.class.php:656
FOGBase\logHistory
static logHistory($string)
Definition: fogbase.class.php:1937
FOGController\key
key(&$key)
Definition: fogcontroller.class.php:770
Route\deletemass
static deletemass($class, $whereItems=[])
Definition: route.class.php:1631
$column
$column
Definition: schema.php:1919
FOGController\$destroyQueryTemplate
$destroyQueryTemplate
Definition: fogcontroller.class.php:111
Route\ids
ids($class, $whereItems=[], $getField='id')
Definition: route.class.php:1567
FOGController\$additionalFields
$additionalFields
Definition: fogcontroller.class.php:65
FOGController\__destruct
__destruct()
Definition: fogcontroller.class.php:159
$str
if(! $Image->isValid()) $str
Definition: progress.php:41
FOGController
Definition: fogcontroller.class.php:29
FOGBase
Definition: fogbase.class.php:25
FOGController\$databaseFields
$databaseFields
Definition: fogcontroller.class.php:53
FOGController\setQuery
setQuery(&$queryData)
Definition: fogcontroller.class.php:1001
FOGController\$insertQueryTemplate
$insertQueryTemplate
Definition: fogcontroller.class.php:105
Route\getData
static getData()
Definition: route.class.php:1173
History
Definition: history.class.php:23
FOGController\$data
$data
Definition: fogcontroller.class.php:35
FOGController\add
add($key, $value)
Definition: fogcontroller.class.php:288
$foglang
$foglang['Display']
Definition: text.php:22
FOGBase\arrayChangeKey
static arrayChangeKey(array &$array, $old_key, $new_key)
Definition: fogbase.class.php:1378
FOGBase\isLoaded
isLoaded($key)
Definition: fogbase.class.php:969
$msg
if($Host->isValid()) $msg
Definition: hostnameloop.php:42
FOGController\__toString
__toString()
Definition: fogcontroller.class.php:172
FOGBase\debug
static debug($txt, $data=array())
Definition: fogbase.class.php:742
FOGController\$databaseFieldsFlipped
$databaseFieldsFlipped
Definition: fogcontroller.class.php:72
FOGController\_testFields
_testFields($key)
Definition: fogcontroller.class.php:188
FOGController\isValid
isValid()
Definition: fogcontroller.class.php:865
FOGController\getManager
getManager()
Definition: fogcontroller.class.php:1039
FOGController\$databaseFieldsToIgnore
$databaseFieldsToIgnore
Definition: fogcontroller.class.php:78
FOGController\$databaseTable
$databaseTable
Definition: fogcontroller.class.php:47