<?php
/**
* Page DocBlock definition
* @package org.zadara.marius.pax
*/
/**
* General interface for a config object.
* The config object is a representation of a hash-map.
*
* @author Marius Zadara <hide@address.com>
* @category Interfaces
* @copyright (C) 2008-2009 Marius Zadara
* @license Free for non-comercial use
* @package org.zadara.marius.pax
* @see IPAXObject
* @since 5.0
*/
interface IConfig extends IPAXObject
{
/**
* Method to set a variable to a value in the hash-map.
* If the key already exists, the value wil be updated.
*
* @access public
* @param string <b>$variable</b> The variable name
* @param mixed <b>$value</b> The variable value
* @return void
*/
public function set($variable, $value);
/**
* Method to get the variabile value from the hash-map.
*
* @access public
* @param string <b>$variable</b> The variable name
* @param mixed <b>$defaultValue</b> The variable default value (used in case the variabile has not been found)
* @return mixed The value of the variables as defined
*/
public function get($variable, $defaultValue=NULL);
/**
* Method to return only the keys.
*
* @access public
* @return array The list of all the keys
*/
public function getKeys();
/**
* Method to return only the values.
*
* @access public
* @return array The list of all the values
*/
public function getValues();
/**
* Method to delete a key.
*
* @access public
* @param string <b>$key</b> The name of the key
* @return boolean True/False if the key has been deleted
*/
public function deleteKey($key);
/**
* Method to delete the keys matching a pattern.
* The match is performed case insensitive.
*
* @access public
* @param string <b>$pattern</b> The pattern to use when searching for the keys
* @return boolean True/False if the key(s) has been deleted
*/
public function deleteKeysLike($pattern);
/**
* Method to get the key-value pairs from the hash-map.
* Due to construction of the hash-map, will return the content of te hash-map.
*
* @access public
* @return array The object's content
*/
public function getKeyValuePairs();
/**
* Method to search if a key exists.
*
* @access public
* @param string <b>$key</b> The key searched
* @return boolean True/False if the key has been found or not
*/
public function keyExists($key);
}
?>