Gumbo PHP Library API Documentation
Map
[
class tree
] [
index
] [
all elements
]
Todo List
Packages:
Buffer
Collection
Composite
Config
Converter
Curl
Date
DB
Debug
Encryption
Error
Factory
Filter
Flyweight
Http
Input
Iterator
List
Load
Lockable
Log
Map
Number
Observer
Output
Query
Record
Router
Session
Setting
Singleton
Template
Timer
Utility
Valid
Source for file Map.class.php
Documentation is available at
Map.class.php
<?php
/**
* Gumbo Library Framework
*
* LICENSE
* This library is being released under the terms of the New BSD License. A
* copy of the license is packaged with the software (LICENSE.txt). If no
* copy is found, a copy of the license template can be found at:
* http://www.opensource.org/licenses/bsd-license.php
*
*
@category
Gumbo
*
@package
Map
*
@copyright
Copyright (c) 2007, iBayou, Michael Luster
*
@license
http://www.opensource.org/licenses/bsd-license.php New BSD License
*
@author
Michael Luster <mluster79@yahoo.com>
*
@link
http://sourceforge.net/projects/phpgumbo
*
@version
0.0.1
*/
/**
* Map Interface
*
* The Map is responsible for creating a reference from a source (internal)
* key to a foreign (external) key. The Source Key is important to the Mapper
* Class. The Foreign Key is from some outside source. Every Source Key must
* have a Foreign Key reference.
*
* The best example to use would be to map HTML Form Input data to the private
* properties of a class. The Source Key would be the name of the private
* property. The Foreign Key would be the name of the HTML Form Field. A Mapper
* Class will use the generated Map to process the information. The Map only
* holds the appropriate key references.
*
*
@category
Gumbo
*
@package
Map
*
@copyright
Copyright (c) 2007, iBayou, Michael Luster
*
@license
http://www.opensource.org/licenses/bsd-license.php New BSD License
*
@author
Michael Luster <mluster79@yahoo.com>
*
@link
http://sourceforge.net/projects/phpgumbo
*
@desc
Map Interface
*
@version
0.0.1
*/
interface
Gumbo_Interface_Map
{
/** ACTION METHODS **/
/**
* Adds a foreign key reference to a source key
*
@param
string
$source_key
*
@param
string
$foreign_key
*/
public
function
add
(
$source_key
,
$foreign_key
)
;
/**
* Removes the foreign key reference to a source key
*
@param
string
$source_key
*/
public
function
remove
(
$source_key
)
;
/**
* Resets all keys
*
@postcondition
empty key references
*/
public
function
reset
(
)
;
/** ACCESSOR METHODS **/
/**
* Returns the source key referenced by the foreign key
*
@precondition
isForeignKey ($foreign_key)
*
@param
string
$foreign_key
*
@return
string
*/
public
function
getKey
(
$foreign_key
)
;
/**
* Returns the foreign key reference to the source key
*
@precondition
isKey ($source_key)
*
@param
string
$source_key
*
@return
string
*/
public
function
getForeignKey
(
$source_key
)
;
/**
* Returns all the keys as an associative array where key=>source_key, val=>foreign_key
*
@return
array
*/
public
function
getAll
(
)
;
/**
* Returns if the source key exists
*
@param
string
$source_key
*
@return
bool
*/
public
function
isKey
(
$source_key
)
;
/**
* Returns if the foreign key exists
*
@param
string
$foreign_key
*
@return
bool
*/
public
function
isForeignKey
(
$foreign_key
)
;
}
?>