RuleNameMatch Class Reference

List of all members.

Public Member Functions

 setNotFoundValue ($mixNotFoundedValue)
 getNotFoundedValue ()
 setNameList ($arrNameList)
 getNameList ()
 addName ($strName, $mixValue=TRUE)
 found ($strName)
 isEmpty ()
 match ($strName)

Protected Attributes

 $arrNameList = array()
 $arrValueList = array()
 $mixNotFoundedValue = FALSE


Detailed Description

Definition at line 12 of file RuleNameMatch.class.php.


Member Function Documentation

addName ( strName,
mixValue = TRUE 
)

Add a class name into the name list

See also:
RuleMatchList->arrNameList

RuleMatchList::setNameList( String[] )

RuleMatchList::getNameList()

Parameters:
string $strName
Returns:
RuleNameMacth me

Definition at line 101 of file RuleNameMatch.class.php.

00102     {
00103         $intKeyName = sizeof( $this->arrNameList );
00104         $this->arrNameList[ $intKeyName ] = $strName;
00105         $this->arrValueList[ $intKeyName ] = $mixValue;
00106         return $this;
00107     }

found ( strName  ) 

Search the element into the array and returns true if founded and false if not

Parameters:
string $strName
Returns:
boolean

Definition at line 116 of file RuleNameMatch.class.php.

00117     {
00118         if ( in_array( $strName , $this->arrNameList ) )
00119         {
00120             return TRUE;
00121         }
00122         else
00123         {
00124             return FALSE;
00125         }
00126     }

getNameList (  ) 

get the array with the name list into the match

See also:
RuleMatchList->arrNameList

RuleMatchList::setNameList( String[] )

Returns:
String[] $arrNameList

Definition at line 87 of file RuleNameMatch.class.php.

00088     {
00089         return $this->arrNameList;
00090     }

getNotFoundedValue (  ) 

Get the not founded value

See also:
RuleNameMatch->mixNotFoundedValue

RuleNameMatch::setNotFoundValue( mixer )

Returns:
mixer $mixNotFoundedValue

Definition at line 61 of file RuleNameMatch.class.php.

Referenced by match().

00062     {
00063         return $this->mixNotFoundedValue;
00064     }

isEmpty (  ) 

Returns if the rule is empty

Returns:
boolean

Definition at line 133 of file RuleNameMatch.class.php.

00134     {
00135         return ( sizeof( $this->arrNameList ) == 0 );
00136     }

match ( strName  ) 

Match the string name

Parameters:
string $strName
Returns:
boolean

Definition at line 144 of file RuleNameMatch.class.php.

References getNotFoundedValue().

00145     {
00146         $intKeyFound = array_search( $strName , $this->arrNameList );
00147         if( $intKeyFound !== FALSE )
00148         {
00149             $mixReturn = $this->arrValueList[ $intKeyFound ];
00150         }
00151         else
00152         {
00153             $mixReturn = $this->getNotFoundedValue();
00154         }
00155         return $mixReturn;
00156     }

setNameList ( arrNameList  ) 

Set the array with the name list into the match

See also:
RuleMatchList->arrNameList

RuleMatchList::getNameList()

Parameters:
String[] $arrNameList
Returns:
RuleNameMatch me

Definition at line 74 of file RuleNameMatch.class.php.

References $arrNameList.

00075     {
00076         $this->arrNameList = $arrNameList;
00077         return $this;
00078     }

setNotFoundValue ( mixNotFoundedValue  ) 

Set the not founded value

See also:
RuleNameMatch->mixNotFoundedValue

RuleNameMatch::getNotFoundValue()

Parameters:
mixer $mixNotFoundedValue
Returns:
RuleNameMatch

Definition at line 48 of file RuleNameMatch.class.php.

References $mixNotFoundedValue.

00049     {
00050         $this->mixNotFoundedValue = $mixNotFoundedValue;
00051         return $this;
00052     }


Member Data Documentation

$arrNameList = array() [protected]

Array with the string name list what should be match

If is empty, anyone can enter.

string[]

Definition at line 22 of file RuleNameMatch.class.php.

Referenced by setNameList().

$arrValueList = array() [protected]

array with the values of the match if founded

array

Definition at line 29 of file RuleNameMatch.class.php.

$mixNotFoundedValue = FALSE [protected]

value of the match when the element not be found into the name list

Default: false
mixer

Definition at line 38 of file RuleNameMatch.class.php.

Referenced by setNotFoundValue().


The documentation for this class was generated from the following file:

Generated on Thu Feb 3 03:55:04 2011 for CodeToDiagram by  doxygen 1.5.9