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)  

windowskey.class.php
Go to the documentation of this file.
1 <?php
25 {
31  protected $databaseTable = 'windowsKeys';
37  protected $databaseFields = array(
38  'id' => 'wkID',
39  'name' => 'wkName',
40  'description' => 'wkDesc',
41  'createdBy' => 'wkCreatedBy',
42  'createdTime' => 'wkCreatedTime',
43  'key' => 'wkKey'
44  );
50  protected $databaseFieldsRequired = array(
51  'name',
52  'key'
53  );
59  protected $additionalFields = array(
60  'images',
61  'imagesnotinme'
62  );
70  public function destroy($key = 'id')
71  {
72  self::getClass('WindowsKeyAssociationManager')
73  ->destroy(
74  array(
75  'windowskeyID' => $this->get('id')
76  )
77  );
78  return parent::destroy($key);
79  }
85  public function save()
86  {
87  parent::save();
88  return $this
89  ->assocSetter('WindowsKey', 'image');
90  }
98  public function addImage($addArray)
99  {
100  return $this->addRemItem(
101  'images',
102  (array)$addArray,
103  'merge'
104  );
105  }
113  public function removeImage($removeArray)
114  {
115  return $this->addRemItem(
116  'images',
117  (array)$removeArray,
118  'diff'
119  );
120  }
126  protected function loadImages()
127  {
128  $imageIDs = self::getSubObjectIDs(
129  'WindowsKeyAssociation',
130  array('windowskeyID' => $this->get('id')),
131  'imageID'
132  );
133  $imageIDs = self::getSubObjectIDs(
134  'Image',
135  array('id' => $imageIDs)
136  );
137  $this->set(
138  'images',
139  (array)$imageIDs
140  );
141  }
147  protected function loadImagesnotinme()
148  {
149  $images = array_diff(
150  self::getSubObjectIDs('Image'),
151  $this->get('images')
152  );
153  $this->set('imagesnotinme', (array)$images);
154  }
155 }
WindowsKey\$databaseTable
$databaseTable
Definition: windowskey.class.php:31
FOGController\addRemItem
addRemItem($key, $array, $array_type)
Definition: fogcontroller.class.php:823
FOGBase\getClass
static getClass($class, $data='', $props=false)
Definition: fogbase.class.php:439
WindowsKey\addImage
addImage($addArray)
Definition: windowskey.class.php:98
WindowsKey\loadImages
loadImages()
Definition: windowskey.class.php:126
WindowsKey\removeImage
removeImage($removeArray)
Definition: windowskey.class.php:113
WindowsKey\destroy
destroy($key='id')
Definition: windowskey.class.php:70
WindowsKey\loadImagesnotinme
loadImagesnotinme()
Definition: windowskey.class.php:147
FOGController
Definition: fogcontroller.class.php:29
WindowsKey\save
save()
Definition: windowskey.class.php:85
WindowsKey
Definition: windowskey.class.php:25
WindowsKey\$databaseFieldsRequired
$databaseFieldsRequired
Definition: windowskey.class.php:50
WindowsKey\$databaseFields
$databaseFields
Definition: windowskey.class.php:37
WindowsKey\$additionalFields
$additionalFields
Definition: windowskey.class.php:59
FOGBase\getSubObjectIDs
static getSubObjectIDs( $object='Host', $findWhere=array(), $getField='id', $not=false, $operator='AND', $orderBy='name', $groupBy=false, $filter='array_unique')
Definition: fogbase.class.php:2006