public function getSerializedEntity($documentClass, $recordId, array $fields = null)
    {
        if (is_array($fields)) {
            return $this->getSingleEntity($documentClass, $recordId, $fields);
        }

        if (!isset($this->entities[$documentClass][$recordId])) {
            $current = $this->getSingleEntity($documentClass, $recordId, $fields);

            if (is_null($current)) {
                $this->entities[$documentClass][$recordId] = null;
            } else {
                $this->entities[$documentClass][$recordId] = $current;
            }
        }

        return $this->entities[$documentClass][$recordId];
    }