deleteID() public method

Delete a record by primary key.
public deleteID ( mixed $id, array $options = [] ) : boolean
$id mixed The primary key value of the record to delete.
$options array An array of options to affect the delete behaviour. Reserved for future use.
return boolean Returns **true** if the delete was successful or **false** otherwise.
Ejemplo n.º 1
0
 /**
  * Delete a particular activity item.
  *
  * @param int $ActivityID The unique ID of activity to be deleted.
  * @param array $Options Not used.
  * @return bool Returns **true** if the activity was deleted or **false** otherwise.
  */
 public function deleteID($ActivityID, $Options = [])
 {
     // Get the activity first.
     $Activity = $this->getID($ActivityID);
     if ($Activity) {
         // Log the deletion.
         $Log = val('Log', $Options);
         if ($Log) {
             LogModel::insert($Log, 'Activity', $Activity);
         }
         // Delete comments on the activity item
         $this->SQL->delete('ActivityComment', ['ActivityID' => $ActivityID]);
         // Delete the activity item
         return parent::deleteID($ActivityID);
     } else {
         return false;
     }
 }