PhpMyObject
[ class tree: PhpMyObject ] [ index: PhpMyObject ] [ all elements ]

Class: PMO_MyMap

Source Location: /fichiers/v0.15/PMO_core/PMO_MyMap.php

Class Overview


This class is a datastructure to stock, retrieve and filter the reference of PMO_Object.


Implements interfaces:

Variables

Methods



Class Details

[line 51]
This class is a datastructure to stock, retrieve and filter the reference of PMO_Object.

Several methods are build to search for an object with criterians. This map is specific to PMO_Object as it use the interface PMO_Object




[ Top ]


Class Variables

$map =

[line 59]

holds an array of PMO_Object in the from of tablename => PMO_Object



Tags:

var:  from SPL
access:  protected

Type:   ArrayIterator


[ Top ]



Class Methods


constructor __construct [line 61]

PMO_MyMap __construct( )



Tags:

access:  public


[ Top ]

method add [line 72]

void add( $row)

Adds an array of PMO_Object to the current map in the form of tablename=>PMO_Object



Tags:

access:  public



Implementation of:
PMO_Map::add()
Add an array of PMO_Object to map tablename=>PMO_Object

Parameters:

array   $row   an array of PMO_Object

[ Top ]

method count [line 255]

int count( )

returns the number of rows in the map



Tags:

access:  public



Implementation of:
PMO_Map::count()
Return number of rows for this PMO_Map
[ Top ]

method fetch [line 228]

array fetch( )

returns one row of the current map array structure

Null is returned at the end and the iterator is reset.

The array is not poped, it's only a cursor that move an index and return the results.




Tags:

access:  public



Implementation of:
PMO_Map::fetch()
return one row of the array structure Null is returned at the end The array is not pop, it's only a cursor that move on index and return the results.
[ Top ]

method fetchTable [line 242]

PMO_Object fetchTable( $tablename)

returns one PMO_Object of row of the current map array structure

Null is returned at the end and the iterator is reset.

The array is not poped, it's only a cursor that move an index and return the results.




Tags:

access:  public



Implementation of:
PMO_Map::fetchTable()
returns one PMO_Object of row of the current map array structure

Parameters:

   $tablename  

[ Top ]

method getMapByObject [line 85]

PMO_Map getMapByObject( PMO_Object $object)

returns a new map from the current map using a PMO_Object as filter

this new map only contains rows that are relative to the passed in object




Tags:

throws:  Exception if there is no PMO_Object for the same table name
access:  public



Implementation of:
PMO_Map::getMapByObject()
build a new map from an other map this new map only contains row that are relative to the object

Parameters:

object   $object   a PMO_Object

[ Top ]

method getMapByObjectByValue [line 111]

PMO_Map getMapByObjectByValue( PMO_Object $object)

returns a new map from the current map using a PMO_Object primary keys as filter

this new map will only contain rows that match the filter

Other values can be NULL as they are not used.




Tags:

throws:  Exception if no object is found
access:  public



Implementation of:
PMO_Map::getMapByObjectByValue()
build a new map from a map that contains row relative to the object. This function use the values of the primary keys to retrieve the lines concerned.

Parameters:

object a   $object   PMO_Object to use as filter

[ Top ]

method getMapByTable [line 188]

PMO_Map getMapByTable( string $tablename)

returns a new map that only contains objects of type tablename



Tags:

throws:  Exception if none has been found
access:  public



Implementation of:
PMO_Map::getMapByTable()
build a new map that only contains objects of type tablename

Parameters:

string   $tablename   the table name to search for

[ Top ]

method getMapByValue [line 172]

PMO_Map getMapByValue( string $tablename, string $attribute, string $value)

returns a new map that only contains objects of type tablename with attribute=value.

Search is done only on one fields. Faster than getMapByObjectByValue but less powerfull.




Tags:

throws:  Exception if no match has been found
access:  public



Implementation of:
PMO_Map::getMapByValue()
build a new map that only contains objects of type tablename with attribute=value.

Parameters:

string   $tablename   table name to search for
string   $attribute   attribute for which we want to check the value
string   $value   value to search for

[ Top ]

method getMapLinked [line 143]

PMO_Map getMapLinked( PMO_Object $object)

Alias of {@see getMapByObject()}



Tags:

access:  public



Implementation of:
PMO_Map::getMapLinked()
Alias of getMapByObject

Parameters:

object   $object   a PMO_Object to use as filter

[ Top ]

method getMapRelated [line 156]

PMO_Map getMapRelated( PMO_Object $object, string $tablename)

build a new map that only contains objects of type tablename relative to our object.



Tags:

throws:  Exception
access:  public



Implementation of:
PMO_Map::getMapRelated()
build a new map that only contains objects of type tablename relative to our object.

Parameters:

object   $object   the PMO_Object to search for
string   $tablename   the table nae for which we want a map

[ Top ]

method getObjectByObject [line 292]

PMO_Object getObjectByObject( PMO_Object $object)

retrieves one object from map using the object primary key as filter

All primary keys must be set, it's more powerfull than getObjectByValue but slower too. If object is not found, return an exception




Tags:

throws:  Exception
access:  public



Implementation of:
PMO_Map::getObjectByObject()
retrieve one object in map comparing the value of primary key of object in param All primary keys must be set, it's more powerfull than getObjectByValue but slower too. If object is not find, return an exception

Parameters:

object   $object   a PMO_Object to serve as filter

[ Top ]

method getObjectByValue [line 270]

PMO_Map getObjectByValue( string $tablename, string $attribute, string $value)

retrieves the first object in map matching with tablename, and attribute=>value

If object is not found, returns an exception




Tags:

throws:  Exception if no object matches the criteria
access:  public



Implementation of:
PMO_Map::getObjectByValue()
retrieve first object in map matching with tablename, and attribute=>value If object is not find return an exception

Parameters:

string   $tablename   table name to search for
string   $attribute   attribute for which we want to check the value
string   $value   value to search for

[ Top ]

method __get [line 317]

void __get( $value)

Only an exception, for not use PMO_Map as PMO_Object



Tags:

throws:  Exception
access:  public


Parameters:

   $value  

[ Top ]


Documentation generated on Wed, 15 Oct 2008 09:17:17 -0400 by phpDocumentor 1.4.1