Created
August 22, 2012 15:43
-
-
Save cgdangelo/3426906 to your computer and use it in GitHub Desktop.
wat?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class X_TigerEDI_Model_Observer_850 extends X_TigerEDI_Model_Observer | |
{ | |
protected $_ediID = 850; | |
private $_ediFiles = array(); | |
/** | |
* @TODO Add response EDIs for generator | |
*/ | |
public function generateFull() | |
{ | |
} | |
public function parse() | |
{ | |
foreach ($this->_getFilesList() as $ediFile) { | |
$ediContents = file_get_contents($ediFile); | |
$ediContents = array_slice(preg_split("/\^/", $ediContents), 0, -1); | |
var_dump($ediFile); | |
} | |
} | |
protected function _getFilesList() | |
{ | |
if ($this->_ediFiles === array()) { | |
$ediFiles = glob(self::TIGEREDI_INCOMING . '*.EDI'); | |
$this->_ediFiles = $ediFiles; | |
} | |
return $this->_ediFiles; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string(54) "/home/x/edi/incoming/file1.EDI" | |
string(54) "/home/x/edi/incoming/file2.EDI" | |
NULL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment