protected function parseMultiRecordResult($objectName, $data)
    {
        $this->resultCount = (int) $data['result']['total_results'];

        if (0 === $this->resultCount) {
            $this->result = array();
        } else {
            if (array_key_exists($objectName, $data['result'])) {
                if ($this->resultHasOnlyOneRecord($objectName, $data)) {
                    $this->result = array($data['result'][$objectName]);
                } else {
                    $this->result = $data['result'][$objectName];
                }
            } else {
                $msg = sprintf('The response does not contain the expected object key \'%s\'', $objectName);

                throw new InvalidArgumentException($msg);
            }
        }
    }