public function parse(Account $account, $file)
    {
        $file = new \SplFileObject($file);
        $file->setCsvControl($this->csvDelimiter, $this->csvEnclosure, $this->csvEscape);
        $file->setFlags(\SplFileObject::DROP_NEW_LINE | \SplFileObject::READ_AHEAD | \SplFileObject::SKIP_EMPTY | \SplFileObject::READ_CSV);

        $transactionMapper = new TransactionMapper(Database::get('money'));
        $transactions      = array();

        $file->seek($this->startAtLine);
        while (!$file->eof()) {

            $this->setLine($file->current());
            $transactions[] = $this->createTransaction($transactionMapper, $account);

            $file->next();
        }

        if ($this->dropNbLastLines > 0) {
            $transactions = array_slice($transactions, 0, -$this->dropNbLastLines);
        }

        return $transactions;
    }
public function parse(Account $account, $file)
    {
        $file = new \SplFileObject($file);
        $file->setCsvControl($this->csvDelimiter, $this->csvEnclosure, $this->csvEscape);
        $file->setFlags(\SplFileObject::DROP_NEW_LINE | \SplFileObject::READ_AHEAD | \SplFileObject::SKIP_EMPTY | \SplFileObject::READ_CSV);

        $transactionMapper = new TransactionMapper(Database::get('money'));
        $transactions      = array();

        $file->seek($this->startAtLine);
        while (!$file->eof()) {

            $this->setLine($file->current());
            $transactions[] = $this->createTransaction($transactionMapper, $account);

            $file->next();
        }

        if ($this->dropNbLastLines > 0) {
            $transactions = array_slice($transactions, 0, -$this->dropNbLastLines);
        }

        return $transactions;
    }
public function parse ( Account $ account , $ file ) { $ file = new \ SplFileObject ( $ file ) ; $ file -> setCsvControl ( $ this -> csvDelimiter , $ this -> csvEnclosure , $ this -> csvEscape ) ; $ file -> setFlags ( \ SplFileObject :: DROP_NEW_LINE | \ SplFileObject :: READ_AHEAD | \ SplFileObject :: SKIP_EMPTY | \ SplFileObject :: READ_CSV ) ; $ transactionMapper = new TransactionMapper ( Database :: get ( 'money' ) ) ; $ transactions = array ( ) ; $ file -> seek ( $ this -> startAtLine ) ; while ( ! $ file -> eof ( ) ) { $ this -> setLine ( $ file -> current ( ) ) ; $ transactions [ ] = $ this -> createTransaction ( $ transactionMapper , $ account ) ; $ file -> next ( ) ; } if ( $ this -> dropNbLastLines > 0 ) { $ transactions = array_slice ( $ transactions , 0 , - $ this -> dropNbLastLines ) ; } return $ transactions ; }
Parse data from file.

@param  Account $account
@param  string $file
@return Transaction[]
Parse data from file .