Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getMatchValue($matchdata, $key, $key2=null, $retain=false) {
- $matchproperties = $matchdata->getProperties();
- $returnstring = "";
- if (array_key_exists($key, $matchproperties)) {
- if ($retain === false) {
- $propertyvalues = $matchdata->getPropertyValues($matchproperties[$key]);
- foreach ($propertyvalues as $tempkey=>$propertyvalue) {
- if ($propertyvalue->getDIType() === 1) $propertyvalues[$tempkey] = $propertyvalue->getNumber();
- if ($propertyvalue->getDIType() === 2) $propertyvalues[$tempkey] = $propertyvalue->getString();
- if ($propertyvalue->getDIType() === 9) $propertyvalues[$tempkey] = $propertyvalue->getTitle()->__toString();
- if ($propertyvalue->getDIType() === 4) $propertyvalues[$tempkey] = $propertyvalue->getBoolean();
- }
- }
- if ($key2 !== null) $returnstring = $propertyvalues[$key2];
- else $returnstring = $propertyvalues;
- }
- return $returnstring;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement