当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_Contact_BAO_Contact::getValues方法代码示例

本文整理汇总了PHP中CRM_Contact_BAO_Contact::getValues方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contact_BAO_Contact::getValues方法的具体用法?PHP CRM_Contact_BAO_Contact::getValues怎么用?PHP CRM_Contact_BAO_Contact::getValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_Contact_BAO_Contact的用法示例。


在下文中一共展示了CRM_Contact_BAO_Contact::getValues方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setDefaultValues

 /**
  * set defaults for the form
  *
  * @return void
  * @access public
  */
 public function setDefaultValues()
 {
     $defaults = array();
     $params = array('id' => $this->_contactId);
     $defaults = array();
     CRM_Contact_BAO_Contact::getValues($params, $defaults);
     return $defaults;
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:14,代码来源:Demographics.php

示例2: run

 /**
  * Run the page.
  *
  * This method is called after the page is created.
  *
  * @return void
  * @access public
  *
  */
 function run()
 {
     // get the emails for this contact
     $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST);
     $params = array('id' => $contactId);
     $defaults = array();
     CRM_Contact_BAO_Contact::getValues($params, $defaults);
     $defaults['privacy_values'] = CRM_Core_SelectValues::privacy();
     $this->assign('contactId', $contactId);
     $this->assign($defaults);
     // check logged in user permission
     CRM_Contact_Page_View::checkUserPermission($this, $contactId);
     // finally call parent
     parent::run();
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:24,代码来源:CommunicationPreferences.php

示例3: run

 /**
  * Run the page.
  *
  * This method is called after the page is created.
  */
 public function run()
 {
     // get the emails for this contact
     $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST);
     $params = array('id' => $contactId);
     $defaults = array();
     CRM_Contact_BAO_Contact::getValues($params, $defaults);
     if (!empty($defaults['gender_id'])) {
         $gender = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id');
         $defaults['gender_display'] = $gender[CRM_Utils_Array::value('gender_id', $defaults)];
     }
     $this->assign('contactId', $contactId);
     $this->assign($defaults);
     //for birthdate format with respect to birth format set
     $this->assign('birthDateViewFormat', CRM_Utils_Array::value('qfMapping', CRM_Utils_Date::checkBirthDateFormat()));
     // check logged in user permission
     CRM_Contact_Page_View::checkUserPermission($this, $contactId);
     // finally call parent
     parent::run();
 }
开发者ID:nielosz,项目名称:civicrm-core,代码行数:25,代码来源:Demographics.php

示例4: run

 /**
  * Run the page.
  *
  * This method is called after the page is created.
  *
  * @return void
  */
 public function run()
 {
     // get the emails for this contact
     $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST);
     $params = array('id' => $contactId);
     $defaults = array();
     CRM_Contact_BAO_Contact::getValues($params, $defaults);
     //get the current employer name
     if (CRM_Utils_Array::value('contact_type', $defaults) == 'Individual') {
         if (!empty($defaults['employer_id']) && !empty($defaults['organization_name'])) {
             $defaults['current_employer'] = $defaults['organization_name'];
             $defaults['current_employer_id'] = $defaults['employer_id'];
         }
     }
     $this->assign('contactId', $contactId);
     $this->assign($defaults);
     // check logged in user permission
     CRM_Contact_Page_View::checkUserPermission($this, $contactId);
     // finally call parent
     parent::run();
 }
开发者ID:kidaa30,项目名称:yes,代码行数:28,代码来源:ContactInfo.php

示例5: run

 /**
  * Run the page.
  *
  * This method is called after the page is created.
  *
  * @return void
  */
 public function run()
 {
     // get the emails for this contact
     $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST);
     $params = array('id' => $contactId);
     $defaults = array();
     CRM_Contact_BAO_Contact::getValues($params, $defaults);
     $defaults['privacy_values'] = CRM_Core_SelectValues::privacy();
     $communicationStyle = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'communication_style_id');
     if (!empty($communicationStyle)) {
         if (!empty($defaults['communication_style_id'])) {
             $defaults['communication_style_display'] = $communicationStyle[CRM_Utils_Array::value('communication_style_id', $defaults)];
         } else {
             // Make sure the field is displayed as long as it is active, even if it is unset for this contact.
             $defaults['communication_style_display'] = '';
         }
     }
     $this->assign('contactId', $contactId);
     $this->assign($defaults);
     // check logged in user permission
     CRM_Contact_Page_View::checkUserPermission($this, $contactId);
     // finally call parent
     parent::run();
 }
开发者ID:BorislavZlatanov,项目名称:civicrm-core,代码行数:31,代码来源:CommunicationPreferences.php

示例6: setDefaultValues

 /**
  * set defaults for the form
  *
  * @return void
  * @access public
  */
 public function setDefaultValues()
 {
     $defaults = array();
     $params = array('id' => $this->_contactId);
     $defaults = array();
     CRM_Contact_BAO_Contact::getValues($params, $defaults);
     $this->_contactType = CRM_Utils_Array::value('contact_type', $defaults);
     if (!empty($defaults['preferred_language'])) {
         $languages = array_flip(CRM_Core_PseudoConstant::languages());
         $defaults['preferred_language'] = $languages[$defaults['preferred_language']];
     }
     // CRM-7119: set preferred_language to default if unset
     if (empty($defaults['preferred_language'])) {
         $config = CRM_Core_Config::singleton();
         $defaults['preferred_language'] = $config->lcMessages;
     }
     foreach (CRM_Contact_BAO_Contact::$_greetingTypes as $greeting) {
         $name = "{$greeting}_display";
         $this->assign($name, CRM_Utils_Array::value($name, $defaults));
     }
     return $defaults;
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:28,代码来源:CommunicationPreferences.php

示例7: _crm_initialize

/**
 * Get an existing contact.
 *
 * Returns a single existing Contact object which matches ALL property
 * values passed in $params. An error object is returned if there is
 * no match, or more than one match. This API can be used to retrieve
 * the CRM internal identifier (contact_id) based on a unique property
 * (e.g. email address). It can also be used to retrieve any desired
 * contact properties based on a known contact_id. Available
 * properties for each type of Contact are listed in the {@link
 * http://objectledge.org/confluence/display/CRM/Data+Model#DataModel-ContactRef
 * CRM Data Model.} Modules may also invoke crm_get_class_properties()
 * to retrieve all available property names, including extended
 * (i.e. custom) properties.contact of the specific type that matches
 * the input params  
 *
 * <b>Primary Location and Communication Info</b>
 *
 * <ul>
 * <li>Primary location properties (email address, phone, postal address,
 * etc.) are available in the Contact data objects. Primary email and
 * phone number are returned by default. Postal address fields and
 * primary instant messenger identifier are returned when specified in
 * $return_properties. For contacts with multiple locations, use
 * crm_get_locations() to retrieve additional location data.</li> 
 * </ul>
 *
 * @see crm_get_class_properties()
 * @see crm_get_locations()
 *
 * @example api/Contact.php
 *
 * @param array $params           Associative array of property name/value
 *                                pairs to attempt to match on.
 * @param array $returnProperties Which properties should be included in the
 *                                returned Contact object. If NULL, the default
 *                                set of properties will be included.
 *
 * @return CRM_Contact|CRM_Core_Error  Return the Contact Object if found, else
 *                                Error Object
 *
 * @access public
 *
 */
function &crm_get_contact($params, $returnProperties = null)
{
    _crm_initialize();
    // empty parameters ?
    if (empty($params)) {
        return _crm_error('$params is empty');
    }
    // correct parameter format ?
    if (!is_array($params)) {
        return _crm_error('$params is not an array');
    }
    if (!CRM_Utils_Array::value('contact_id', $params)) {
        $returnProperties = array('display_name');
        list($contacts, $options) = crm_contact_search($params, $returnProperties);
        if (count($contacts) != 1) {
            return _crm_error(count($contacts) . " contacts matching input params.");
        }
        $contactIds = array_keys($contacts);
        $params['contact_id'] = $contactIds[0];
    }
    $params['id'] = $params['contact_id'];
    $ids = array();
    $contact =& CRM_Contact_BAO_Contact::getValues($params, $defaults, $ids);
    if ($contact == null || is_a($contact, 'CRM_Core_Error') || !$contact->id) {
        return _crm_error('Did not find contact object for ' . $params['contact_id']);
    }
    unset($params['id']);
    require_once str_replace('_', DIRECTORY_SEPARATOR, "CRM_Contact_BAO_" . $contact->contact_type) . ".php";
    $contact->contact_type_object = eval('return CRM_Contact_BAO_' . $contact->contact_type . '::getValues( $params, $defaults, $ids );');
    $contact->location =& CRM_Core_BAO_Location::getValues($params, $defaults, $ids, 2);
    //changed the location no
    $contact->custom_values =& CRM_Core_BAO_CustomValue::getContactValues($contact->id);
    return $contact;
}
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:78,代码来源:Contact.php

示例8: retrieve

 /**
  * Takes a bunch of params that are needed to match certain criteria and
  * retrieves the relevant objects. Typically the valid params are only
  * contact_id. We'll tweak this function to be more full featured over a period
  * of time. This is the inverse function of create. It also stores all the retrieved
  * values in the default array
  *
  * @param array $params   (reference ) an assoc array of name/value pairs
  * @param array $defaults (reference ) an assoc array to hold the name / value pairs
  *                        in a hierarchical manner
  * @param array $ids      (reference) the array that holds all the db ids
  *
  * @return object CRM_Contact_BAO_Contact object
  * @access public
  * @static
  */
 function retrieve(&$params, &$defaults, &$ids)
 {
     $contact = CRM_Contact_BAO_Contact::getValues($params, $defaults, $ids);
     unset($params['id']);
     require_once str_replace('_', DIRECTORY_SEPARATOR, "CRM_Contact_BAO_" . $contact->contact_type) . ".php";
     eval('$contact->contact_type_object =& CRM_Contact_BAO_' . $contact->contact_type . '::getValues( $params, $defaults, $ids );');
     $locParams = $params + array('entity_id' => $params['contact_id'], 'entity_table' => CRM_Contact_BAO_Contact::getTableName());
     $contact->location =& CRM_Core_BAO_Location::getValues($locParams, $defaults, $ids, 3);
     $contact->notes =& CRM_Core_BAO_Note::getValues($params, $defaults, $ids);
     $contact->relationship =& CRM_Contact_BAO_Relationship::getValues($params, $defaults, $ids);
     $contact->groupContact =& CRM_Contact_BAO_GroupContact::getValues($params, $defaults, $ids);
     $activityParam = array('entity_id' => $params['contact_id']);
     $contact->activity =& CRM_Core_BAO_History::getValues($activityParam, $defaults, 'Activity');
     $activityParam = array('contact_id' => $params['contact_id']);
     $defaults['openActivity'] = array('data' => CRM_Contact_BAO_Contact::getOpenActivities($activityParam, 0, 3), 'totalCount' => CRM_Contact_BAO_Contact::getNumOpenActivity($params['contact_id']));
     return $contact;
 }
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:33,代码来源:Contact.php


注:本文中的CRM_Contact_BAO_Contact::getValues方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。