xcat-core/xCAT-web/lib/XCAT/XCATNode/XCATNodeManager.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
829 B
PHP

<?php
/**
* Manages a collection of XCATNode objects.
*/
class XCATNodeManager {
/**
* An array of nodes, keyed by name.
*/
var $nodes = array();
function XCATNodeManager() {
$nodes = array();
}
function &getInstance() {
static $instance;
if(is_null($instance)) {
$instance = new XCATNodeManager();
}
return $instance;
}
function getNodes() {
return $this->nodes;
}
function setNodes($pNodes) {
$this->nodes = $pNodes;
}
function addNode($node) {
$this->nodes[$node->getName()] = $node;
}
function removeNode($node) {
$this->nodes[$node->getName()] = NULL;
}
function getNodeByName($nodeName) {
$node = NULL;
if(array_key_exists($nodeName, $this->nodes)) {
$node = $this->nodes[$nodeName];
}
return $node;
}
}
?>