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 | |
Definition at line 12 of file RuleNameMatch.class.php.
| addName | ( | $ | strName, | |
| $ | mixValue = TRUE | |||
| ) |
Add a class name into the name list
RuleMatchList::setNameList( String[] )
RuleMatchList::getNameList()
| string | $strName |
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
| string | $strName |
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
RuleMatchList::setNameList( String[] )
Definition at line 87 of file RuleNameMatch.class.php.
| getNotFoundedValue | ( | ) |
Get the not founded value
RuleNameMatch::setNotFoundValue( mixer )
Definition at line 61 of file RuleNameMatch.class.php.
Referenced by match().
| isEmpty | ( | ) |
Returns if the rule is empty
Definition at line 133 of file RuleNameMatch.class.php.
| match | ( | $ | strName | ) |
Match the string name
| string | $strName |
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
RuleMatchList::getNameList()
| String[] | $arrNameList |
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
RuleNameMatch::getNotFoundValue()
| mixer | $mixNotFoundedValue |
Definition at line 48 of file RuleNameMatch.class.php.
References $mixNotFoundedValue.
00049 { 00050 $this->mixNotFoundedValue = $mixNotFoundedValue; 00051 return $this; 00052 }
$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
Definition at line 38 of file RuleNameMatch.class.php.
Referenced by setNotFoundValue().
1.5.9