xcat-core/xCAT-web/lib/XCAT/XCATNodeGroup/XCATNodeGroupManager.class.php
jbjohnso c99d72a179 Initial xCAT 2.0 import
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2007-10-26 22:44:33 +00:00

52 lines
980 B
PHP

<?php
/**
* Manages a collection of XCATNodeGroup objects.
*/
class XCATNodeGroupManager {
/**
* An array of node groups, keyed by name.
*/
var $nodeGroups = array();
function XCATNodeGroupManager() {
$nodes = array();
}
function &getInstance() {
static $instance;
if(is_null($instance)) {
$instance = new XCATNodeGroupManager();
}
return $instance;
}
function getNodeGroups() {
return $this->nodeGroups;
}
function setNodeGroups($pNodeGroups) {
$this->nodeGroups = $pNodeGroups;
}
function addNodeGroup($nodeGroup) {
$this->nodeGroups[$nodeGroup->getName()] = $nodeGroup;
}
function removeNodeGroup($nodeGroup) {
$this->nodeGroups[$nodeGroup->getName()] = NULL;
}
function getNodeGroupByName($nodeGroupName) {
$nodeGroup = NULL;
if(array_key_exists($nodeGroupName, $this->nodeGroups)) {
$nodeGroup = $this->nodeGroups[$nodeGroupName];
}
return $nodeGroup;
}
}
?>