本文整理汇总了PHP中DataAccessObject::searchMatchingIds方法的典型用法代码示例。如果您正苦于以下问题:PHP DataAccessObject::searchMatchingIds方法的具体用法?PHP DataAccessObject::searchMatchingIds怎么用?PHP DataAccessObject::searchMatchingIds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataAccessObject
的用法示例。
在下文中一共展示了DataAccessObject::searchMatchingIds方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMatchingIdsInDb
protected function getMatchingIdsInDb(DataAccessObject $dao, PermissionsManager $permissionManager, Tracker $tracker, PFUser $user, array $criteria)
{
$dump_criteria = array();
foreach ($criteria as $c) {
$dump_criteria[$c->field->getName()] = $c->field->getCriteriaValue($c);
}
$dao->logStart(__METHOD__, json_encode(array('user' => $user->getUserName(), 'project' => $tracker->getGroupId(), 'query' => $dump_criteria, 'trackers' => array($tracker->getId()))));
$matching_ids = array();
$group_id = $tracker->getGroupId();
$permissions = $permissionManager->getPermissionsAndUgroupsByObjectid($tracker->getId());
$contributor_field = $tracker->getContributorField();
$contributor_field_id = $contributor_field ? $contributor_field->getId() : null;
$additional_from = array();
$additional_where = array();
foreach ($criteria as $c) {
if ($f = $c->getFrom()) {
$additional_from[] = $f;
}
if ($w = $c->getWhere()) {
$additional_where[] = $w;
}
}
$matching_ids['id'] = '';
$matching_ids['last_changeset_id'] = '';
$matching_ids_result = $dao->searchMatchingIds($group_id, $tracker->getId(), $additional_from, $additional_where, $user, $permissions, $contributor_field_id);
if ($matching_ids_result) {
$matching_ids = $matching_ids_result->getRow();
if ($matching_ids) {
if (substr($matching_ids['id'], -1) === ',') {
$matching_ids['id'] = substr($matching_ids['id'], 0, -1);
}
if (substr($matching_ids['last_changeset_id'], -1) === ',') {
$matching_ids['last_changeset_id'] = substr($matching_ids['last_changeset_id'], 0, -1);
}
}
}
$nb_matching = $matching_ids['id'] ? substr_count($matching_ids['id'], ',') + 1 : 0;
$dao->logEnd(__METHOD__, $nb_matching);
return $matching_ids;
}