private function getDocumentSource($field = null)
    {
        $docSource = $this->document->getSource() ? : [];
        $result    = $docSource;

        if (null !== $field) {
            $result = null;
            if (isset($docSource[$field])) {
                $result = is_array($docSource[$field]) ? current($docSource[$field]) : $docSource[$field];
            }
        }

        return $result;
    }
private function getDocumentSource($field = null)
    {
        $docSource = $this->document->getSource() ? : [];
        $result    = $docSource;

        if (null !== $field) {
            $result = null;
            if (isset($docSource[$field])) {
                $result = is_array($docSource[$field]) ? current($docSource[$field]) : $docSource[$field];
            }
        }

        return $result;
    }
private function getDocumentSource ( $ field = null ) { $ docSource = $ this -> document -> getSource ( ) ? : [ ] ; $ result = $ docSource ; if ( null !== $ field ) { $ result = null ; if ( isset ( $ docSource [ $ field ] ) ) { $ result = is_array ( $ docSource [ $ field ] ) ? current ( $ docSource [ $ field ] ) : $ docSource [ $ field ] ; } } return $ result ; }
Return the ES source document for the current product.

@param string $field The document field to retrieve.

@return array
Return the ES source document for the current product .