Source for file bookingentryro.php

Documentation is available at bookingentryro.php

  1. <?php
  2. /**
  3. * Booking entry object for viewing booking
  4. *
  5. @author    Stuart Prescott
  6. @copyright  Copyright Stuart Prescott
  7. @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  8. @version    $Id$
  9. @package    Bumblebee
  10. @subpackage DBObjects
  11. */
  12.  
  13. /** Load ancillary functions */
  14. require_once 'inc/typeinfo.php';
  15.  
  16. /** uses Booking object */
  17. require_once 'inc/bookings/booking.php';
  18. /** obtain data from database */
  19. require_once 'inc/bookings/bookingdata.php';
  20.  
  21. /**
  22. * Booking entry object for viewing booking
  23. *
  24. @package    Bumblebee
  25. @subpackage DBObjects
  26. */
  27. class BookingEntryRO {
  28.   /** @var integer   booking id number to display */
  29.   var $id;
  30.   /** @var Booking   booking data object */
  31.   var $data;
  32.   
  33.   /**
  34.   *  Create the new BookingEntryRO object, filling from db
  35.   *
  36.   * @param integer  $id   booking id number to look up
  37.   */
  38.   function BookingEntryRO($id{
  39.     $this->id = $id;
  40.     $this->_fill();
  41.   }
  42.  
  43.   /**
  44.   * load data from database
  45.   */
  46.   function _fill({
  47.     $bookdata new BookingData(array('id' => $this->id)true);
  48.     $this->data = $bookdata->dataEntry();
  49.   }
  50.  
  51.   /**
  52.   * display data to user
  53.   *
  54.   * @param boolean $displayAdmin   display admin-only data
  55.   * @param boolean $displayOwner   display booking-owner-only data
  56.   */
  57.   function display($displayAdmin$displayOwner{
  58.     return $this->displayAsTable($displayAdmin$displayOwner);
  59.   }
  60.  
  61.   /**
  62.   * display data to user in a table
  63.   *
  64.   * @param boolean $displayAdmin   display admin-only data
  65.   * @param boolean $displayOwner   display booking-owner-only data
  66.   */
  67.   function displayAsTable($displayAdmin$displayOwner{
  68.     $t '<table class="tabularobject">';
  69.     $t .= $this->data->displayInTable(2$displayAdmin$displayOwner);
  70.     $t .= '</table>';
  71.     return $t;
  72.   }
  73.  

Documentation generated on Tue, 06 Mar 2007 10:00:54 +0000 by phpDocumentor 1.3.0