Drest\Query\ExposeFields::configurePushRequest PHP Method

configurePushRequest() public method

Unlike the configuring of the Pull request, this function will return the formatted array in a ResultSet object This is only applicable for a HTTP push (POST/PUT/PATCH) call
public configurePushRequest ( array $pushed ) : DrestCommon\ResultSet
$pushed array - the data push on the request
return DrestCommon\ResultSet
    public function configurePushRequest($pushed)
    {
        // Offset the array by one of it has a string key and is size of 1
        if (sizeof($pushed) == 1 && is_string(key($pushed))) {
            $rootKey = key($pushed);
            $pushed = $this->filterPushExpose($pushed[key($pushed)], $this->fields);
            return ResultSet::create($pushed, $rootKey);
        } else {
            throw DrestException::unableToHandleACollectionPush();
        }
    }