本文整理汇总了PHP中Ubirimi\Util::array_equal方法的典型用法代码示例。如果您正苦于以下问题:PHP Util::array_equal方法的具体用法?PHP Util::array_equal怎么用?PHP Util::array_equal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ubirimi\Util
的用法示例。
在下文中一共展示了Util::array_equal方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getByParameters
//.........这里部分代码省略.........
$projectWithAssigneeReporterBrowsePermission = array();
$queryProjectPartReporter = array();
$queryProjectPartAssignee = array();
for ($i = 0; $i < count($parameters['project']); $i++) {
$permissions = UbirimiContainer::get()['repository']->get(PermissionScheme::class)->getDataByProjectIdAndPermissionId($parameters['project'][$i], Permission::PERM_BROWSE_PROJECTS);
while ($permissions && ($permission = $permissions->fetch_array(MYSQLI_ASSOC))) {
if ($permission['reporter'] == 1) {
$queryProjectPartReporter[] = '(issue_main_table.user_reported_id = ' . $loggedInUserId . ' and issue_main_table.project_id = ' . $parameters['project'][$i] . ')';
$projectWithAssigneeReporterBrowsePermission[] = $parameters['project'][$i];
}
if ($permission['current_assignee'] == 1) {
$queryProjectPartAssignee[] = '(issue_main_table.user_assigned_id = ' . $loggedInUserId . ' and issue_main_table.project_id = ' . $parameters['project'][$i] . ')';
$projectWithAssigneeReporterBrowsePermission[] = $parameters['project'][$i];
}
}
}
$projectWithAssigneeReporterBrowsePermission = array_unique($projectWithAssigneeReporterBrowsePermission);
$queryWhereReporter = '';
$queryWhereAssignee = '';
if (count($queryProjectPartReporter)) {
$queryWhereReporter = '(' . implode(' OR ', $queryProjectPartReporter) . ')';
}
if (count($queryProjectPartAssignee)) {
$queryWhereAssignee = '(' . implode(' OR ', $queryProjectPartAssignee) . ')';
}
$queryPartReporterAssignee = array();
if (!empty($queryWhereReporter)) {
$queryPartReporterAssignee[] = $queryWhereReporter;
}
if (!empty($queryWhereAssignee)) {
$queryPartReporterAssignee[] = $queryWhereAssignee;
}
if (count($projectWithAssigneeReporterBrowsePermission)) {
if (Util::array_equal($parameters['project'], $projectWithAssigneeReporterBrowsePermission)) {
$queryWhere .= ' (issue_main_table.project_id IN (' . implode(',', $parameters['project']) . ') OR ';
} else {
$queryWhere .= ' (issue_main_table.project_id IN (' . implode(',', array_diff($parameters['project'], $projectWithAssigneeReporterBrowsePermission)) . ') OR ';
}
$queryWhere .= '(' . implode(' OR ', $queryPartReporterAssignee) . ')) ';
$queryWhere .= ' AND ';
} else {
$queryWhere .= ' issue_main_table.project_id IN (' . implode(',', $parameters['project']) . ') AND ';
}
} else {
$queryWhere .= ' issue_main_table.project_id = ? AND ';
$parameterType .= 'i';
$parameterArray[] = $parameters['project'];
}
}
if (isset($parameters['issue_id'])) {
if (is_array($parameters['issue_id'])) {
$queryWhere .= ' issue_main_table.id IN (' . implode(', ', $parameters['issue_id']) . ') AND ';
} else {
$queryWhere .= ' issue_main_table.id = ? AND ';
$parameterType .= 'i';
$parameterArray[] = $parameters['issue_id'];
}
}
if (isset($parameters['nr'])) {
$queryWhere .= ' issue_main_table.nr = ? AND ';
$parameterType .= 'i';
$parameterArray[] = $parameters['nr'];
}
if (isset($parameters['code_nr'])) {
$queryWhere .= " CONCAT(project.code, '-', issue_main_table.nr) = ? AND ";
$parameterType .= 's';