mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 11:22:27 +00:00 
			
		
		
		
	git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
		
			
				
	
	
		
			52 lines
		
	
	
		
			980 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			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;
 | |
| 	}
 | |
| }
 | |
| ?>
 |