Example #1
0
 /**
  * @see DataBackend::getAgenciesForBank()
  * @throws DataBackendIOException
  * @throws DataBackendException
  * @return Agency[]
  */
 public function getAgenciesForBank(Bank $bank)
 {
     try {
         $context = $this->defineContextInterval($bank->getBankID());
         $agencies = array();
         for ($line = $context->getStart(); $line <= $context->getEnd(); $line++) {
             $content = $this->parser->readLine($line);
             if (!$this->parser->isMainAgency($content)) {
                 $agencies[] = $this->parser->getAgency($bank, $content);
             }
         }
         return $agencies;
     } catch (UndefinedFileParserContextException $e) {
         throw new \LogicException("Start and end should be defined.");
     } catch (FileParserIOException $e) {
         throw new DataBackendIOException();
     } catch (ParseException $e) {
         throw new DataBackendException();
     }
 }
Example #2
0
 public function getMainAgency(Bank $bank)
 {
     // Return the Doctrine proxy
     return $bank->getMainAgency();
 }