public static function FindObjectByStringValue($filter, $propName, $listOfObjects, $key = null) {
        $match = false;
        if ($key === null) {
            foreach ($listOfObjects as $obj) {
                if ($obj->$propName() === $filter) {
                    $match = $obj;
                    break;
                }
            }
        } else {
            foreach ($listOfObjects as $obj) {
                if ($obj[$key]->$propName() === $filter) {
                    $match = $obj[$key];
                    break;
                }
            }
        }

        return $match;
    }