Exemplo n.º 1
0
 /**
  * Add
  * 
  * Adding the boarding information including the location, location description, transport types, destination, 
  * transport number, seat, gate, counter and gate information.
  * 
  * @name add
  * @param string Location 
  * @param mixed Context
  * @param mixed TransportType 
  * @param mixed Destination 
  * @param mixed TransportNumber
  * @param mixed Seat
  * @param mixed Counter
  * @param mixed Gate
  * @access public
  * @method void
  */
 public function add($node, $context = null, $type = null, $destination = null, $transportNumber = null, $seat = null, $counter = null, $gate = null)
 {
     if ($destination) {
         Transport::makeTransportType($type)->setTransportNumber($transportNumber);
     }
     if ($transportNumber) {
         Transport::makeTransportType($type)->setDestination($destination);
     }
     if ($destination && method_exists(Transport::makeTransportType($type), 'setCounter')) {
         Transport::makeTransportType($type)->setCounter($counter);
     }
     if ($gate && method_exists(Transport::makeTransportType($type), 'setGate')) {
         Transport::makeTransportType($type)->setGate($gate);
     }
     if ($seat && method_exists(Transport::makeTransportType($type), 'setSeat')) {
         Transport::makeTransportType($type)->setSeat($seat);
     }
     $transport = Transport::makeTransportType($type)->data;
     Destination::add($node, array('desc' => $context, 'transport' => $transport));
 }
Exemplo n.º 2
0
 * 			other free or open source software licenses.
 * @since Version 1.0
 * 
 */
require_once 'helper/loader.php';
echo "<h1>Create Destination :: Class Demo</h1>";
echo "<p>\n\tSteps are starting from <b>A</b> to <b>L</b>\n\t<br />\n\tIn this demo start point sets to <b>B</b> and end point <b>J</b> and current location <b>D</b>\n\t</p>";
Destination::add('A', 'Info here');
Destination::add('B', 'Info here');
Destination::add('C', 'Info here');
Destination::add('D', 'Info here');
Destination::add('E', 'Info here');
Destination::add('F', 'Info here');
Destination::add('J', 'Info here');
Destination::add('K', 'Info here');
Destination::add('L', 'Info here');
Destination::setBegin('B');
Destination::setCurrent('D');
Destination::setEnd('J');
echo "<h2>Current point:</h2><pre>";
print_r(Destination::getCurrent());
echo "</pre>";
echo "<h2>Next point:</h2><pre>";
print_r(Destination::getNext());
echo "</pre>";
echo "<h2>Previous point:</h2><pre>";
print_r(Destination::getPrev());
echo "</pre>";
echo "<h2>All next steps:</h2><pre>getAllNext";
print_r(Destination::getAllNext());
echo "</pre>";