本文整理汇总了PHP中CRM_Contact_DAO_RelationshipType::fields方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contact_DAO_RelationshipType::fields方法的具体用法?PHP CRM_Contact_DAO_RelationshipType::fields怎么用?PHP CRM_Contact_DAO_RelationshipType::fields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Contact_DAO_RelationshipType
的用法示例。
在下文中一共展示了CRM_Contact_DAO_RelationshipType::fields方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: civicrm_relationship_types_get
/**
* Function to get all relationship type
* retruns An array of Relationship_type
* * @access public
*/
function civicrm_relationship_types_get($params = null)
{
_civicrm_initialize();
require_once 'CRM/Contact/DAO/RelationshipType.php';
$relationshipTypes = array();
$relationshipType = array();
$relationType = new CRM_Contact_DAO_RelationshipType();
if (!empty($params) && is_array($params)) {
$properties = array_keys($relationType->fields());
foreach ($properties as $name) {
if (array_key_exists($name, $params)) {
$relationType->{$name} = $params[$name];
}
}
}
$relationType->find();
while ($relationType->fetch()) {
_civicrm_object_to_array(clone $relationType, $relationshipType);
$relationshipTypes[] = $relationshipType;
}
return $relationshipTypes;
}
示例2: array
/**
* returns the list of fields that can be exported
*
* @access public
* return array
*/
function &export($prefix = false)
{
if (!$GLOBALS['_CRM_CONTACT_DAO_RELATIONSHIPTYPE']['_export']) {
$GLOBALS['_CRM_CONTACT_DAO_RELATIONSHIPTYPE']['_export'] = array();
$fields =& CRM_Contact_DAO_RelationshipType::fields();
foreach ($fields as $name => $field) {
if (CRM_Utils_Array::value('export', $field)) {
if ($prefix) {
$GLOBALS['_CRM_CONTACT_DAO_RELATIONSHIPTYPE']['_export']['relationship_type'] =& $fields[$name];
} else {
$GLOBALS['_CRM_CONTACT_DAO_RELATIONSHIPTYPE']['_export'][$name] =& $fields[$name];
}
}
}
}
return $GLOBALS['_CRM_CONTACT_DAO_RELATIONSHIPTYPE']['_export'];
}