function farm_asset_unarchive_action in farmOS 7
Action function for farm_asset_unarchive_action.
Un-archives an asset.
Parameters
FarmAsset $asset: The asset entity object.
array $context: Array with parameters for this action.
File
- modules/
farm/ farm_asset/ farm_asset.module, line 435 - Farm asset - A farm asset entity type.
Code
function farm_asset_unarchive_action(FarmAsset $asset, $context = array()) {
// Only proceed if the asset is already archived.
if (empty($asset->archived)) {
return;
}
// Un-archive the asset..
$asset->archived = 0;
// Save the asset.
farm_asset_save($asset);
}