
Public Member Functions | |
| setDefaultItemValue ($objDefaultItemValue) | |
| getDefaultItemValue () | |
| setItemList (array $arrItemList, $arrValues=null) | |
| getItemList () | |
| addItem ($objItem, $objValue=null) | |
| isEmpty () | |
The Match Class is feed with a Match Itens, here called as "itens".
The Itens are append to the Match Class to configure it. They are append into it by the MatchListInterface::setItemList() and MatchListInterface::addItem() method.
Each iten can be compared with each name and a boolean result must be extract from this operation.
The mode as each item interact with the name to get the result it is customizable to each implementation of this interface.
When MatchListInterface::found() method be called, the class should compare the name with each item, one by one. Case some compared item returns true, the MatchListInterface::found() method will returns true. Otherwise, the method will returns false.
When MatchListInterface::match() method be called, the class should compare the name with each item, one by one. Case some compared item returns true, the MatchListInterface::match() method will returns the value of this item, what will be the default value if not informed into the MatchListInterface::addItem() method or into the MatchListInterface::setItemList() method. The itens should be checked into the include order. The last add will be the last compared.
Case, after try match the name with all the itens without success, the MatchListInterface::match() should return the NotFoundValue informed into the MatchListInterface::setNotFoundValue().
To know if the match has some filter, the method MatchListInterface::isEmpty() returns true if the list itens has no elements and returns false otherwise.
Definition at line 46 of file MatchListInterface.interface.php.
| addItem | ( | $ | objItem, | |
| $ | objValue = null | |||
| ) |
Add a item into the item list
| object | $objItem | |
| object | $objValue |
Implemented in MatchName, and MatchRegularExpression.
| getDefaultItemValue | ( | ) |
Get the default item value.
This value <value> what will be saved on some item <item> when this setter dont inform its value
Implemented in MatchName, and MatchRegularExpression.
| getItemList | ( | ) |
Get the array with the item list into the match
Implemented in MatchName, and MatchRegularExpression.
| isEmpty | ( | ) |
Returns true if the item list is empty returns false if not.
If is empty the match allways will return the not found value
Implemented in MatchName, and MatchRegularExpression.
| setDefaultItemValue | ( | $ | objDefaultItemValue | ) |
Set the not found value.
Changing this value will change how the result of the match() method when not item match with the received name
| object | $objNotFoundValue |
| object | $objNotFoundValue |
Implemented in MatchName, and MatchRegularExpression.
| setItemList | ( | array $ | arrItemList, | |
| $ | arrValues = null | |||
| ) |
Set the array with the item list into the match. Can receive the array with the values of each item. If the array with values not received, the default value to the itens will be true
| <item>[] | $arrItemList | |
| <value>[] | $arrValues |
| MatchException |
Implemented in MatchName, and MatchRegularExpression.
1.5.9