Refactor phone type CRM-12464
[civicrm-core.git] / CRM / Core / BAO / Phone.php
index 14572de4e2d1a81a5058688c54ebb76d154d0218..4189aa06535edaad2210dd199652e4c3c37823be 100644 (file)
@@ -109,7 +109,7 @@ class CRM_Core_BAO_Phone extends CRM_Core_DAO_Phone {
 
     $cond = NULL;
     if ($type) {
-      $phoneTypeId = array_search($type, CRM_Core_PseudoConstant::phoneType());
+      $phoneTypeId = array_search($type, CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id'));
       if ($phoneTypeId) {
         $cond = " AND civicrm_phone.phone_type_id = $phoneTypeId";
       }
@@ -179,7 +179,7 @@ ORDER BY civicrm_phone.is_primary DESC,  phone_id ASC ";
 
     $cond = NULL;
     if ($type) {
-      $phoneTypeId = array_search($type, CRM_Core_PseudoConstant::phoneType());
+      $phoneTypeId = array_search($type, CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id'));
       if ($phoneTypeId) {
         $cond = " AND civicrm_phone.phone_type_id = $phoneTypeId";
       }