Campustream 1.0
A social network MQP for WPI
|
00001 <?php 00002 00003 group('statuses'); 00004 00005 desc('Deletes a status message'); 00006 task('delete', function ($args) { 00007 00008 force_execution_on( any_web_server ); 00009 00010 $id = array_shift($args); 00011 if (!$id) { 00012 echo "Usage: hubcap statuses:delete [status_id]"; 00013 return false; 00014 } 00015 00016 $status = ActiveRecord::find('Status_Model', "SELECT * FROM statuses WHERE id = $id LIMIT 1"); 00017 if (!$status->is_loaded()) { 00018 echo "Invalid status ID"; 00019 return false; 00020 } 00021 00022 $status->delete(); 00023 00024 echo "Status deleted"; 00025 00026 });