Exemplo n.º 1
0
 /**
  * Decorates the link object
  *
  * @since   1.3
  * @access  public
  * @param   string
  * @return  
  */
 public function decorate(&$link)
 {
     $db = JFactory::getDBO();
     $image = new mtImages($db);
     $image->load(array('link_id' => $link->link_id, 'ordering' => 1));
     require_once __DIR__ . '/models/listing.php';
     $model = new ListingModel('Listing');
     $link->link_image = $image->filename;
     $links = array(&$link);
     $model->decorate($links);
 }
Exemplo n.º 2
0
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return ListingModel the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = ListingModel::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }