当前位置: 首页>>代码示例>>PHP>>正文


PHP Util::array_column方法代码示例

本文整理汇总了PHP中Ubirimi\Util::array_column方法的典型用法代码示例。如果您正苦于以下问题:PHP Util::array_column方法的具体用法?PHP Util::array_column怎么用?PHP Util::array_column使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Ubirimi\Util的用法示例。


在下文中一共展示了Util::array_column方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $searchQuery = $request->request->get('code');
     $clientId = $session->get('client/id');
     $loggedInUserId = $session->get('user/id');
     $projects = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($clientId, $session->get('user/id'), Permission::PERM_BROWSE_PROJECTS, 'array');
     $projects = Util::array_column($projects, 'id');
     // search first for a perfect match
     $issueResult = $this->getRepository(Issue::class)->getByParameters(array('project' => $projects, 'code_nr' => $searchQuery), $loggedInUserId, null, $loggedInUserId);
     if ($issueResult) {
         $issue = $issueResult->fetch_array(MYSQLI_ASSOC);
         return new Response($issue['id']);
     } else {
         return new Response('-1');
     }
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:17,代码来源:QuickSearchController.php

示例2: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
         $clientId = $session->get('client/id');
         $clientSettings = $session->get('client/settings');
     } else {
         $clientId = $this->getRepository(UbirimiClient::class)->getClientIdAnonymous();
         $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
     }
     $client = $this->getRepository(UbirimiClient::class)->getById($clientId);
     $date = $request->request->get('date');
     $project = $request->request->get('project');
     if ($project == 'all') {
         $projectsMenu = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($session->get('client/id'), $session->get('user/id'), Permission::PERM_BROWSE_PROJECTS, 'array');
         $projectIds = Util::array_column($projectsMenu, 'id');
     } else {
         $projectIds = array($project);
     }
     $historyList = null;
     $endDate = $date;
     $startDate = date_sub(new \DateTime($date, new \DateTimeZone($clientSettings['timezone'])), date_interval_create_from_date_string('2 days'));
     do {
         $historyList = Util::getProjectHistory($projectIds, 0, null, date_format($startDate, 'Y-m-d'), $endDate);
         if (null == $historyList && date_format($startDate, 'Y-m-d H:i:s') == $client['date_created']) {
             break;
         }
         $startDate = date_sub($startDate, date_interval_create_from_date_string('2 days'));
         $startDate->setTime(0, 0, 0);
         if (date_format($startDate, 'Y-m-d') < $client['date_created']) {
             $startDate = new \DateTime($client['date_created'], new \DateTimeZone($clientSettings['timezone']));
             break;
         }
     } while ($historyList == null);
     $historyData = array();
     $userData = array();
     while ($historyList && ($history = $historyList->fetch_array(MYSQLI_ASSOC))) {
         $historyData[substr($history['date_created'], 0, 10)][$history['user_id']][$history['date_created']][] = $history;
         $userData[$history['user_id']] = array('picture' => $history['avatar_picture'], 'first_name' => $history['first_name'], 'last_name' => $history['last_name']);
     }
     $index = 0;
     return $this->render(__DIR__ . '/../Resources/views/project/_activityStream.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:42,代码来源:GetActivityStreamChunkController.php

示例3: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $projectId = $session->get('selected_project_id');
     $userId = $request->get('id');
     $loggedInUserId = $session->get('user/id');
     $user = $this->getRepository(UbirimiUser::class)->getById($userId);
     if ($user['client_id'] != $session->get('client/id')) {
         return new RedirectResponse('/general-settings/bad-link-access-denied');
     }
     $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($session->get('client/id'));
     $groups = $this->getRepository(UbirimiGroup::class)->getByUserIdAndProductId($userId, SystemProduct::SYS_PRODUCT_YONGO);
     $stats = $this->getRepository(IssueStatistic::class)->getUnresolvedIssuesByProjectForUser($userId);
     $hasAdministrationGlobalPermission = $this->getRepository(UbirimiUser::class)->hasGlobalPermission($session->get('client/id'), $userId, GlobalPermission::GLOBAL_PERMISSION_YONGO_ADMINISTRATORS);
     $hasSystemAdministrationGlobalPermission = $this->getRepository(UbirimiUser::class)->hasGlobalPermission($session->get('client/id'), $userId, GlobalPermission::GLOBAL_PERMISSION_YONGO_SYSTEM_ADMINISTRATORS);
     $projectsForBrowsing = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($session->get('client/id'), $session->get('user/id'), Permission::PERM_BROWSE_PROJECTS, 'array');
     $projectIds = array();
     if ($projectsForBrowsing) {
         $projectIds = Util::array_column($projectsForBrowsing, 'id');
     }
     $menuSelectedCategory = 'user';
     $session->set('selected_product_id', SystemProduct::SYS_PRODUCT_YONGO);
     $hoursPerDay = $session->get('yongo/settings/time_tracking_hours_per_day');
     $daysPerWeek = $session->get('yongo/settings/time_tracking_days_per_week');
     $historyList = Util::getProjectHistory($projectIds, 0, $userId);
     $historyData = array();
     $userData = array();
     while ($historyList && ($history = $historyList->fetch_array(MYSQLI_ASSOC))) {
         $historyData[substr($history['date_created'], 0, 10)][$history['user_id']][$history['date_created']][] = $history;
         $userData[$history['user_id']] = array('picture' => $history['avatar_picture'], 'first_name' => $history['first_name'], 'last_name' => $history['last_name']);
     }
     $index = 0;
     $startDate = date_sub(new \DateTime(Util::getServerCurrentDateTime(), new \DateTimeZone($clientSettings['timezone'])), date_interval_create_from_date_string('1 months'));
     $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / User: ' . $user['first_name'] . ' ' . $user['last_name'] . ' / Profile';
     return $this->render(__DIR__ . '/../../Resources/views/user/ViewSummary.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:36,代码来源:ViewSummaryController.php

示例4: while

</div>
                    <?php 
    }
    ?>
                </div>
                <?php 
    if ($strategyIssue) {
        ?>
                    <?php 
        $strategyIssue->data_seek(0);
        ?>
                    <?php 
        while ($issue = $strategyIssue->fetch_array(MYSQLI_ASSOC)) {
            ?>
                        <?php 
            if (!in_array($issue['status'], Util::array_column($statuses, 'id'))) {
                continue;
            }
            $workflowUsed = UbirimiContainer::get()['repository']->get(YongoProject::class)->getWorkflowUsedForType($issue['issue_project_id'], $issue['type']);
            $stepWorkflowFrom = UbirimiContainer::get()['repository']->get(Workflow::class)->getStepByWorkflowIdAndStatusId($workflowUsed['id'], $issue[Field::FIELD_STATUS_CODE]);
            $parentId = -1;
            if ($issue['parent_id']) {
                $parentId = $issue['parent_id'];
            }
            ?>
                        <div style="width: 100%" id="issue_in_column_<?php 
            echo $columns[$i]['id'] . '_' . $issue['id'] . '_' . $issue['issue_project_id'] . '_' . $stepWorkflowFrom['id'] . '_' . $workflowUsed['id'] . '_' . $index . '_' . $parentId;
            ?>
" class="draggableIssueAgileBasic draggableIssueAgile_<?php 
            echo $index;
            ?>
开发者ID:spiasecki,项目名称:ubirimi,代码行数:31,代码来源:_strategy_body.php

示例5: deleteById

 public function deleteById($boardId)
 {
     $boardColumnsArray = UbirimiContainer::get()['repository']->get(Board::class)->getColumns($boardId, 'array');
     if ($boardColumnsArray) {
         $boardColumnsIds = Util::array_column($boardColumnsArray, 'id');
         $query = "delete from agile_board_column_status where agile_board_column_id IN (" . implode(', ', $boardColumnsIds) . ')';
         $stmt = UbirimiContainer::get()['db.connection']->prepare($query);
         $stmt->execute();
     }
     $query = "delete from agile_board_column where agile_board_id = ?";
     $stmt = UbirimiContainer::get()['db.connection']->prepare($query);
     $stmt->bind_param("i", $boardId);
     $stmt->execute();
     $query = "delete from agile_board_project where agile_board_id = ?";
     $stmt = UbirimiContainer::get()['db.connection']->prepare($query);
     $stmt->bind_param("i", $boardId);
     $stmt->execute();
     $sprintIdsArray = UbirimiContainer::get()['repository']->get(Sprint::class)->getByBoardId($boardId, 'array', 'id');
     for ($i = 0; $i < count($sprintIdsArray); $i++) {
         $query = "delete from agile_board_sprint_issue where agile_board_sprint_id = ?";
         $stmt = UbirimiContainer::get()['db.connection']->prepare($query);
         $stmt->bind_param("i", $sprintIdsArray[$i]);
         $stmt->execute();
     }
     $query = "delete from agile_board_sprint where agile_board_id = ?";
     $stmt = UbirimiContainer::get()['db.connection']->prepare($query);
     $stmt->bind_param("i", $boardId);
     $stmt->execute();
     $query = "delete from agile_board where id = ? limit 1";
     $stmt = UbirimiContainer::get()['db.connection']->prepare($query);
     $stmt->bind_param("i", $boardId);
     $stmt->execute();
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:33,代码来源:Board.php


注:本文中的Ubirimi\Util::array_column方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。