예제 #1
0
 /**
  * Delete the grant.
  *
  * @param int $id
  *   Grant id.
  *
  * @return bool|mixed
  */
 public static function del($id)
 {
     CRM_Utils_Hook::pre('delete', 'Grant', $id, CRM_Core_DAO::$_nullArray);
     $grant = new CRM_Grant_DAO_Grant();
     $grant->id = $id;
     $grant->find();
     // delete the recently created Grant
     $grantRecent = array('id' => $id, 'type' => 'Grant');
     CRM_Utils_Recent::del($grantRecent);
     if ($grant->fetch()) {
         $results = $grant->delete();
         CRM_Utils_Hook::post('delete', 'Grant', $grant->id, $grant);
         return $results;
     }
     return FALSE;
 }
예제 #2
0
 /**
  * Function to delete the grant
  *
  * @param int $id  grant id
  *
  * @access public
  * @static
  *
  */
 static function del($id)
 {
     require_once 'CRM/Grant/DAO/Grant.php';
     $grant = new CRM_Grant_DAO_Grant();
     $grant->id = $id;
     $grant->find();
     // delete the recently created Grant
     require_once 'CRM/Utils/Recent.php';
     $grantRecent = array('id' => $id, 'type' => 'Grant');
     CRM_Utils_Recent::del($grantRecent);
     while ($grant->fetch()) {
         return $grant->delete();
     }
     return false;
 }