예제 #1
0
 /**
  * @return array
  */
 public function findConnections(ConnectionQuery $query)
 {
     // send request
     $result = $this->sendAndParseQuery($query);
     // load pages
     for ($i = 0; $i < abs($query->page); $i++) {
         // load next page
         $pageQuery = new ConnectionPageQuery($query, (string) $result->ConRes->ConResCtxt);
         $result = $this->sendAndParseQuery($pageQuery);
     }
     $connections = [];
     if ($result->ConRes->ConnectionList->Connection) {
         foreach ($result->ConRes->ConnectionList->Connection as $connection) {
             $connections[] = Entity\Schedule\Connection::createFromXml($connection, null);
         }
     }
     return $connections;
 }
예제 #2
0
파일: API.php 프로젝트: BJDev95/Transport
 /**
  * @return array
  */
 public function findConnections(ConnectionQuery $query)
 {
     // send request
     $response = $this->sendQuery($query);
     // parse result
     $result = simplexml_load_string($response->getContent());
     // load pages
     for ($i = 0; $i < abs($query->page); $i++) {
         // load next page
         $pageQuery = new ConnectionPageQuery($query, (string) $result->ConRes->ConResCtxt);
         $response = $this->sendQuery($pageQuery);
         $result = simplexml_load_string($response->getContent());
     }
     $connections = array();
     if ($result->ConRes->ConnectionList->Connection) {
         foreach ($result->ConRes->ConnectionList->Connection as $connection) {
             $connections[] = Entity\Schedule\Connection::createFromXml($connection, null);
         }
     }
     return $connections;
 }
예제 #3
0
 public function testCreateFromXml()
 {
     $xml = simplexml_load_file(__DIR__ . '/../../../../fixtures/archive/connection-2012-01-16.xml');
     $this->assertEquals($this->getConnection(), Connection::createFromXml($xml->ConRes->ConnectionList->Connection));
 }