本文整理汇总了PHP中CRM_Core_DAO::escapeStrings方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_DAO::escapeStrings方法的具体用法?PHP CRM_Core_DAO::escapeStrings怎么用?PHP CRM_Core_DAO::escapeStrings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_DAO
的用法示例。
在下文中一共展示了CRM_Core_DAO::escapeStrings方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: reconcileUnknownModules
public function reconcileUnknownModules()
{
$knownModules = array();
if (array_key_exists(0, $this->moduleIndex) && is_array($this->moduleIndex[0])) {
$knownModules = array_merge($knownModules, array_keys($this->moduleIndex[0]));
}
if (array_key_exists(1, $this->moduleIndex) && is_array($this->moduleIndex[1])) {
$knownModules = array_merge($knownModules, array_keys($this->moduleIndex[1]));
}
$dao = new CRM_Core_DAO_Managed();
if (!empty($knownModules)) {
$in = CRM_Core_DAO::escapeStrings($knownModules);
$dao->whereAdd("module NOT IN ({$in})");
}
$dao->find();
while ($dao->fetch()) {
$params = array('version' => 3, 'id' => $dao->entity_id);
$result = civicrm_api($dao->entity_type, 'delete', $params);
if ($result['is_error']) {
$this->onApiError($params, $result);
}
CRM_Core_DAO::executeQuery('DELETE FROM civicrm_managed WHERE id = %1', array(1 => array($dao->id, 'Integer')));
}
}
示例2: reconcileUnknownModules
public function reconcileUnknownModules()
{
$knownModules = array();
if (array_key_exists(0, $this->moduleIndex) && is_array($this->moduleIndex[0])) {
$knownModules = array_merge($knownModules, array_keys($this->moduleIndex[0]));
}
if (array_key_exists(1, $this->moduleIndex) && is_array($this->moduleIndex[1])) {
$knownModules = array_merge($knownModules, array_keys($this->moduleIndex[1]));
}
$dao = new CRM_Core_DAO_Managed();
if (!empty($knownModules)) {
$in = CRM_Core_DAO::escapeStrings($knownModules);
$dao->whereAdd("module NOT IN ({$in})");
}
$dao->find();
while ($dao->fetch()) {
$this->removeStaleEntity($dao);
}
}