/** * given an acknowledgment feed file, load into a DOMDocument object * attach it into a DOMXPath object and then query it using a constant * that hold XPath for extracting the related exported file * and then return an array of key acknowledgment map to the given acknowledgment file * and a 'related' key mapped to the extracted exported file in the acknowledgment file * @param string $ackFile the full path to the acknowledgment to extract the exported file related to it * @param string $exportedDir the directory to where exported sent file exists * @return array */ protected function _extractAckExportedFile($ackFile, $exportedDir) { $doc = $this->_coreHelper->getNewDomDocument(); $doc->load($ackFile); $xpath = $this->_coreHelper->getNewDOMXPath($doc); return [self::ACK_KEY => $ackFile, self::RELATED_KEY => $exportedDir . DS . $this->_coreHelper->extractNodeVal($xpath->query(self::XPATH_ACK_EXPORTED_FILE, $this->_coreHelper->getDomElement($doc)))]; }