src/snac/data/User.php
/**
     * Replaces this object's data with the given associative array
     *
     * @param string[][] $data This objects data in array form
     * @return boolean true on success, false on failure
     */
Replaces this object's data with the given associative array
@param string[][] $data This objects data in array form
@return boolean true on success, false on failure
Replaces this object ' s data with the given associative array @param string [] [] $data This objects data in array form @return boolean true on success false on failure
public function fromArray($data) {
        $this->userid = $data["userid"] ?? null;
        $this->userName = $data["userName"] ?? null;
        $this->firstName = $data["firstName"] ?? null;
        $this->lastName = $data["lastName"] ?? null;
        $this->fullName = $data["fullName"] ?? null;
        $this->avatar = $data["avatar"] ?? null;
        $this->avatarSmall = $data["avatarSmall"] ?? null;
        $this->avatarLarge = $data["avatarLarge"] ?? null;
        $this->email = $data["email"] ?? null;
        $this->workEmail = $data["workEmail"] ?? null;
        $this->workPhone = $data["workPhone"] ?? null;
        $this->numUnreadMessages = $data["unreadMessageCount"] ?? 0;
        $this->token = $data["token"] ?? null;
        $this->active = $data["active"] ?? false;
        if (isset($data["affiliation"]) && $data['affiliation'] != null) {
            $this->affiliation = new \snac\data\Constellation($data["affiliation"]);
        } else {
            $this->affiliation = null;
        }
        unset($this->roleList);
        $this->roleList = array();
        if (isset($data["roleList"])) {
            foreach ($data["roleList"] as $i => $entry) {
                if ($entry != null)
                    $this->roleList[$i] = new \snac\data\Role($entry);
            }
        }
        unset($this->apikeys);
        $this->apikeys = array();
        if (isset($data["apikeys"])) {
            foreach ($data["apikeys"] as $i => $entry) {
                if ($entry != null)
                    $this->apikeys[$i] = new \snac\data\APIKey($entry);
            }
        }
        return true;
    }
public function fromArray ( $ data ) { $ this -> userid = $ data [ " userid " ] ?? null ; $ this -> userName = $ data [ " userName " ] ?? null ; $ this -> firstName = $ data [ " firstName " ] ?? null ; $ this -> lastName = $ data [ " lastName " ] ?? null ; $ this -> fullName = $ data [ " fullName " ] ?? null ; $ this -> avatar = $ data [ " avatar " ] ?? null ; $ this -> avatarSmall = $ data [ " avatarSmall " ] ?? null ; $ this -> avatarLarge = $ data [ " avatarLarge " ] ?? null ; $ this -> email = $ data [ " email " ] ?? null ; $ this -> workEmail = $ data [ " workEmail " ] ?? null ; $ this -> workPhone = $ data [ " workPhone " ] ?? null ; $ this -> numUnreadMessages = $ data [ " unreadMessageCount " ] ?? 0 ; $ this -> token = $ data [ " token " ] ?? null ; $ this -> active = $ data [ " active " ] ?? false ; if ( isset ( $ data [ " affiliation " ] ) && $ data [ 'affiliation' ] != null ) { $ this -> affiliation = new \ snac \ data \ Constellation ( $ data [ " affiliation " ] ) ; } else { $ this -> affiliation = null ; } unset ( $ this -> roleList ) ; $ this -> roleList = array ( ) ; if ( isset ( $ data [ " roleList " ] ) ) { foreach ( $ data [ " roleList " ] as $ i => $ entry ) { if ( $ entry != null ) $ this -> roleList [ $ i ] = new \ snac \ data \ Role ( $ entry ) ; } } unset ( $ this -> apikeys ) ; $ this -> apikeys = array ( ) ; if ( isset ( $ data [ " apikeys " ] ) ) { foreach ( $ data [ " apikeys " ] as $ i => $ entry ) { if ( $ entry != null ) $ this -> apikeys [ $ i ] = new \ snac \ data \ APIKey ( $ entry ) ; } } return true ; }
Replaces this object's data with the given associative array
 @param string[][] $data This objects data in array form
 @return boolean true on success, false on failure
Replaces this object ' s data with the given associative array @param string [] [] $data This objects data in array form @return boolean true on success false on failure