Example #1
0
 /**
  * Remove an asset
  *
  * @param   integer $asset
  * @return  boolean
  */
 public function removeAsset($asset)
 {
     // Remove the asset
     if ($asset instanceof Asset) {
         if (!$asset->remove()) {
             $this->setError(Lang::txt('Failed to remove asset.'));
             return false;
         }
     } else {
         $tbl = new Tables\Asset($this->_db);
         if (!$tbl->remove($asset)) {
             $this->setError(Lang::txt('Failed to remove asset.'));
             return false;
         }
     }
     // Reset the asset list so the next time assets
     // are called, the list if fresh
     $this->_assets = null;
     return true;
 }