public function syncUserList()
    {
        // If no internal cache exists yet, get its value from LazyJsonMapper.
        if ($this->_userList === null) {
            $this->getUserList(); // Builds our "_userList" variable. Throws.
        }

        // Now, we need to create a new, internal LazyJsonMapper data array for
        // our object. In undefined (unmapped) properties, you are ONLY allowed
        // to store basic data types. Not objects. So we will need to convert
        // all User objects to real array data. Otherwise OTHER calls would fail
        // due to invalid internal data when we try things like `printJson()`.
        $newObjectData = [];
        foreach ($this->_userList as $k => $v) {
            $newObjectData[$k] = is_object($v) && $v instanceof LazyJsonMapper
                               ? $v->asArray() // Throws.
                               : $v; // Is already a valid value.
        }

        // Now give the new object data to LazyJsonMapper, which ensures that it
        // contains all of the same values as our updated cache! This replaces
        // the ENTIRE internal JSON property storage, so be aware of that!
        $this->assignObjectData($newObjectData); // Throws.
    }
public function syncUserList()
    {
        // If no internal cache exists yet, get its value from LazyJsonMapper.
        if ($this->_userList === null) {
            $this->getUserList(); // Builds our "_userList" variable. Throws.
        }

        // Now, we need to create a new, internal LazyJsonMapper data array for
        // our object. In undefined (unmapped) properties, you are ONLY allowed
        // to store basic data types. Not objects. So we will need to convert
        // all User objects to real array data. Otherwise OTHER calls would fail
        // due to invalid internal data when we try things like `printJson()`.
        $newObjectData = [];
        foreach ($this->_userList as $k => $v) {
            $newObjectData[$k] = is_object($v) && $v instanceof LazyJsonMapper
                               ? $v->asArray() // Throws.
                               : $v; // Is already a valid value.
        }

        // Now give the new object data to LazyJsonMapper, which ensures that it
        // contains all of the same values as our updated cache! This replaces
        // the ENTIRE internal JSON property storage, so be aware of that!
        $this->assignObjectData($newObjectData); // Throws.
    }
public function syncUserList ( ) { // If no internal cache exists yet, get its value from LazyJsonMapper. if ( $ this -> _userList === null ) { $ this -> getUserList ( ) ; // Builds our "_userList" variable. Throws. } // Now, we need to create a new, internal LazyJsonMapper data array for // our object. In undefined (unmapped) properties, you are ONLY allowed // to store basic data types. Not objects. So we will need to convert // all User objects to real array data. Otherwise OTHER calls would fail // due to invalid internal data when we try things like `printJson()`. $ newObjectData = [ ] ; foreach ( $ this -> _userList as $ k => $ v ) { $ newObjectData [ $ k ] = is_object ( $ v ) && $ v instanceof LazyJsonMapper ? $ v -> asArray ( ) // Throws. : $ v ; // Is already a valid value. } // Now give the new object data to LazyJsonMapper, which ensures that it // contains all of the same values as our updated cache! This replaces // the ENTIRE internal JSON property storage, so be aware of that! $ this -> assignObjectData ( $ newObjectData ) ; // Throws. }
Syncs the user list cache with the LazyJsonMapper core storage.

Note that we could build these steps into `setUserList()`. But by having
it as a separate function, you are able to just update specific User
objects and then call `syncUserList()` to write them back to the core.

@throws LazyJsonMapperException
Syncs the user list cache with the LazyJsonMapper core storage .