Exemple #1
0
 /**
  * Constructor
  *
  * @param   mixed $oid Object Id
  * @return  oid
  */
 public function __construct($oid = null)
 {
     // create needed objects
     $this->_db = \App::get('db');
     // load page jtable
     $this->_tbl = new $this->_tbl_name($this->_db);
     // load object
     if (is_numeric($oid)) {
         $this->_tbl->load($oid);
     } else {
         if (is_object($oid) || is_array($oid)) {
             $this->bind($oid);
         }
     }
     // load versions
     $pageVersionArchive = new Page\Version\Archive();
     $this->_versions = $pageVersionArchive->versions('list', array('pageid' => $this->get('id', -1), 'orderby' => 'version DESC', 'limit' => 25));
 }
Exemple #2
0
 /**
  * Get Page Versions
  *
  * @return  object \Hubzero\Base\ItemList
  */
 public function versions()
 {
     if (!isset($this->_versions)) {
         $pageVersionArchive = new Page\Version\Archive();
         $this->_versions = $pageVersionArchive->versions('list', array('pageid' => $this->get('id', -1), 'orderby' => 'version DESC', 'limit' => 25));
     }
     return $this->_versions;
 }