Move Email, Address, etc. is_primary handling on delete to a hook
[civicrm-core.git] / CRM / Core / BAO / Phone.php
index 260b2e69736ab34e2cd7d7ad88621c17f09efb51..6f9da9eccb516a131fee3082cd770c5d820bd44b 100644 (file)
@@ -234,12 +234,14 @@ ORDER BY ph.is_primary DESC, phone_id ASC ";
   /**
    * Call common delete function.
    *
-   * @param int $id
+   * @see \CRM_Contact_BAO_Contact::on_hook_civicrm_post
    *
+   * @param int $id
+   * @deprecated
    * @return bool
    */
   public static function del($id) {
-    return CRM_Contact_BAO_Contact::deleteObjectWithPrimary('Phone', $id);
+    return (bool) self::deleteRecord(['id' => $id]);
   }
 
 }