src/Person.php
public static function fromIdentifier($identifierKey, $identifierValue)
    {
        /** @var null|Person $person */
        $person = null;

        /** @var string $simpleIdentifier */
        $simpleIdentifier = "";

        /** @var string[] $validIdentifierKeys */
        $validIdentifierKeys = [
            "uwregid", "uwnetid", "employee_id", "student_number", "student_system_key", "development_id"
        ];

        /** @var string[] $simpleIdentifierKeys */
        $simpleIdentifierKeys = ["uwregid", "uwnetid"];

        /** @var boolean $identifierKeyIsValid */
        $identifierKeyIsValid = in_array($identifierKey, $validIdentifierKeys);

        /** @var boolean $identifierKeyIsSimple */
        $identifierKeyIsSimple = in_array($identifierKey, $simpleIdentifierKeys);

        if ($identifierKeyIsValid === false) {
            throw new \Exception(
                "Identifier key '$identifierKey' must be one of [" . implode(", ", $validIdentifierKeys) . "]."
            );
        }

        if ($identifierKeyIsSimple === true) {
            $simpleIdentifier = $identifierValue;
        } else {
            $resp = static::getPersonConnection()->execGET(
                "person.json?$identifierKey=$identifierValue"
            );
            $resp = static::parse($resp->getData());

            if (array_key_exists("Persons", $resp) === true && sizeof($resp["Persons"]) > 0) {
                $simpleIdentifier = $resp["Persons"][0]["PersonFullURI"]["UWNetID"];
            }
        }

        if ($simpleIdentifier !== "") {
            $resp = static::getPersonConnection()->execGET(
                "person/$simpleIdentifier/full.json"
            );
            $resp = static::parse($resp->getData());

            if (array_key_exists("UWRegID", $resp) === true) {
                $person = new static();
                $person = static::fill($person, $resp);
            }
        }

        return $person;
    }
public static function fromIdentifier($identifierKey, $identifierValue)
    {
        /** @var null|Person $person */
        $person = null;

        /** @var string $simpleIdentifier */
        $simpleIdentifier = "";

        /** @var string[] $validIdentifierKeys */
        $validIdentifierKeys = [
            "uwregid", "uwnetid", "employee_id", "student_number", "student_system_key", "development_id"
        ];

        /** @var string[] $simpleIdentifierKeys */
        $simpleIdentifierKeys = ["uwregid", "uwnetid"];

        /** @var boolean $identifierKeyIsValid */
        $identifierKeyIsValid = in_array($identifierKey, $validIdentifierKeys);

        /** @var boolean $identifierKeyIsSimple */
        $identifierKeyIsSimple = in_array($identifierKey, $simpleIdentifierKeys);

        if ($identifierKeyIsValid === false) {
            throw new \Exception(
                "Identifier key '$identifierKey' must be one of [" . implode(", ", $validIdentifierKeys) . "]."
            );
        }

        if ($identifierKeyIsSimple === true) {
            $simpleIdentifier = $identifierValue;
        } else {
            $resp = static::getPersonConnection()->execGET(
                "person.json?$identifierKey=$identifierValue"
            );
            $resp = static::parse($resp->getData());

            if (array_key_exists("Persons", $resp) === true && sizeof($resp["Persons"]) > 0) {
                $simpleIdentifier = $resp["Persons"][0]["PersonFullURI"]["UWNetID"];
            }
        }

        if ($simpleIdentifier !== "") {
            $resp = static::getPersonConnection()->execGET(
                "person/$simpleIdentifier/full.json"
            );
            $resp = static::parse($resp->getData());

            if (array_key_exists("UWRegID", $resp) === true) {
                $person = new static();
                $person = static::fill($person, $resp);
            }
        }

        return $person;
    }
Queries PWS/SWS to generate a Person, given an identifier type and value.

Identifier type must be one of ["uwregid", "uwnetid", "employee_id", "student_number",
"student_system_key", "development_id"].

@param string $identifierKey
@param string $identifierValue
@return null|Person
@throws \Exception If $identifierKey is not one of ["uwregid", "uwnetid", "employee_id",
"student_number", "student_system_key",
"development_id"].