本文整理汇总了PHP中CRM_Core_BAO_Domain::find方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_BAO_Domain::find方法的具体用法?PHP CRM_Core_BAO_Domain::find怎么用?PHP CRM_Core_BAO_Domain::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_BAO_Domain
的用法示例。
在下文中一共展示了CRM_Core_BAO_Domain::find方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
/**
* Get the domain BAO
*
* @return null|object CRM_Core_BAO_Domain
* @access public
* @static
*/
static function &getDomain($reset = null)
{
static $domain = NULL;
if (!$domain || $reset) {
$domain = new CRM_Core_BAO_Domain();
$domain->id = CRM_Core_Config::domainID();
if (!$domain->find(TRUE)) {
CRM_Core_Error::fatal();
}
}
return $domain;
}
示例2:
/**
* Get the domain BAO
*
* @return null|object CRM_Core_BAO_Domain
* @access public
* @static
*/
static function &getDomain()
{
static $domain = null;
if (!$domain) {
$domain = new CRM_Core_BAO_Domain();
$domain->id = CRM_Core_Config::domainID();
if (!$domain->find(true)) {
CRM_Core_Error::fatal();
}
}
return $domain;
}
示例3: contactDelete
/**
* Delete contact, ensuring it is not the domain contact
*
* @param int $contactID
* Contact ID to delete
*/
public function contactDelete($contactID)
{
$domain = new CRM_Core_BAO_Domain();
$domain->contact_id = $contactID;
if (!$domain->find(TRUE)) {
$this->callAPISuccess('contact', 'delete', array('id' => $contactID, 'skip_undelete' => 1));
}
}
示例4: contactDelete
/**
* @param $contactID
*
* @return array|int
*/
function contactDelete($contactID)
{
$params = array('id' => $contactID, 'skip_undelete' => 1, 'debug' => 1);
$domain = new CRM_Core_BAO_Domain();
$domain->contact_id = $contactID;
if ($domain->find(TRUE)) {
// we are finding tests trying to delete the domain contact in cleanup
//since this is mainly for cleanup lets put a safeguard here
return;
}
$result = $this->callAPISuccess('contact', 'delete', $params);
return $result;
}