Ejemplo n.º 1
0
 /**
  * Reading data from inaccessible properties
  *
  * @since   1.1.0
  *
  * @param   string  $field
  * @return  mixed
  *
  * @uses    Route::get
  * @uses    Route::uri
  */
 public function __get($field)
 {
     switch ($field) {
         case 'list_items_url':
             return Route::get('admin/menu/item')->uri(array('id' => $this->id));
             break;
         case 'add_item_url':
             return Route::get('admin/menu/item')->uri(array('id' => $this->id, 'action' => 'add'));
             break;
         case 'edit_url':
             return Route::get('admin/menu')->uri(array('id' => $this->id, 'action' => 'edit'));
             break;
         case 'delete_url':
             return Route::get('admin/menu')->uri(array('id' => $this->id, 'action' => 'delete'));
             break;
     }
     return parent::__get($field);
 }
Ejemplo n.º 2
0
 /**
  * @see ORM::__get()
  */
 public function __get($column)
 {
     if ($column == "owner") {
         // This relationship depends on an outside module, which may not be present so handle
         // failures gracefully.
         try {
             return model_cache::get("user", $this->owner_id);
         } catch (Exception $e) {
             return null;
         }
     } else {
         return parent::__get($column);
     }
 }
Ejemplo n.º 3
0
 public function title()
 {
     return parent::__get('title');
 }
Ejemplo n.º 4
0
 /**
  * Reading data from inaccessible properties
  *
  * @param   string  $field
  * @return  mixed
  *
  * @uses  HTML::chars
  * @uses  Route::get
  * @uses  Route::uri
  * @uses  Path::load
  */
 public function __get($field)
 {
     switch ($field) {
         case 'name':
             return HTML::chars(parent::__get('name'));
             break;
         case 'image':
             return is_null(parent::__get('image')) ? 'media/images/camera.png' : parent::__get('image');
             break;
         case 'rawname':
             // Raw fields without markup. Usage: during edit or etc!
             return parent::__get('name');
             break;
         case 'rawurl':
             // Raw fields without markup. Usage: during edit or etc!
             return Route::get($this->type)->uri(array('action' => 'term', 'id' => $this->id));
             break;
         case 'url':
         case 'link':
             // Model specific links; view, edit, delete url's.
             return ($path = Path::load($this->rawurl)) ? $path['alias'] : $this->rawurl;
             break;
         case 'edit_url':
             // Model specific links; view, edit, delete url's.
             return Route::get('admin/term')->uri(array('id' => $this->id, 'action' => 'edit'));
             break;
         case 'delete_url':
             // Model specific links; view, edit, delete url's.
             return Route::get('admin/term')->uri(array('id' => $this->id, 'action' => 'delete'));
             break;
     }
     return parent::__get($field);
 }