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


PHP Project::getAllByClientID方法代码示例

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


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

示例1: componentArchivedProjects

 public function componentArchivedProjects()
 {
     if (!isset($this->target)) {
         $this->projects = entities\Project::getAllRootProjects(true);
         $this->project_count = count($this->projects);
     } elseif ($this->target == 'team') {
         $this->team = entities\Team::getB2DBTable()->selectById($this->id);
         $projects = array();
         foreach (entities\Project::getAllByOwner($this->team) as $project) {
             $projects[$project->getID()] = $project;
         }
         foreach (entities\Project::getAllByLeader($this->team) as $project) {
             $projects[$project->getID()] = $project;
         }
         foreach (entities\Project::getAllByQaResponsible($this->team) as $project) {
             $projects[$project->getID()] = $project;
         }
         foreach ($this->team->getAssociatedProjects() as $project_id => $project) {
             $projects[$project_id] = $project;
         }
         $final_projects = array();
         foreach ($projects as $project) {
             if ($project->isArchived()) {
                 $final_projects[] = $project;
             }
         }
         $this->projects = $final_projects;
     } elseif ($this->target == 'client') {
         $this->client = entities\Client::getB2DBTable()->selectById($this->id);
         $projects = entities\Project::getAllByClientID($this->client->getID());
         $final_projects = array();
         foreach ($projects as $project) {
             if (!$project->isArchived()) {
                 $final_projects[] = $project;
             }
         }
         $this->projects = $final_projects;
     } elseif ($this->target == 'project') {
         $this->parent = entities\Project::getB2DBTable()->selectById($this->id);
         $this->projects = $this->parent->getChildren(true);
     }
     $this->project_count = count($this->projects);
 }
开发者ID:founderio,项目名称:thebuggenie,代码行数:43,代码来源:Components.php

示例2: runClientDashboard

 /**
  * Client Dashboard
  *
  * @param \thebuggenie\core\framework\Request $request
  */
 public function runClientDashboard(framework\Request $request)
 {
     $this->client = null;
     try {
         $this->client = entities\Client::getB2DBTable()->selectById($request['client_id']);
         $projects = entities\Project::getAllByClientID($this->client->getID());
         $final_projects = array();
         foreach ($projects as $project) {
             if (!$project->isArchived()) {
                 $final_projects[] = $project;
             }
         }
         $this->projects = $final_projects;
         $this->forward403Unless($this->client->hasAccess());
     } catch (\Exception $e) {
         framework\Logging::log($e->getMessage(), 'core', framework\Logging::LEVEL_WARNING);
         return $this->return404(framework\Context::getI18n()->__('This client does not exist'));
     }
 }
开发者ID:nrensen,项目名称:thebuggenie,代码行数:24,代码来源:Main.php

示例3: runDeleteClient

 public function runDeleteClient(framework\Request $request)
 {
     try {
         try {
             $client = entities\Client::getB2DBTable()->selectById($request['client_id']);
         } catch (\Exception $e) {
         }
         if (!$client instanceof entities\Client) {
             throw new \Exception($this->getI18n()->__("You cannot delete this client"));
         }
         if (entities\Project::getAllByClientID($client->getID()) !== null) {
             foreach (entities\Project::getAllByClientID($client->getID()) as $project) {
                 $project->setClient(null);
                 $project->save();
             }
         }
         $client->delete();
         return $this->renderJSON(array('success' => true, 'message' => $this->getI18n()->__('The client was deleted')));
     } catch (\Exception $e) {
         $this->getResponse()->setHttpStatus(400);
         return $this->renderJSON(array('error' => $e->getMessage()));
     }
 }
开发者ID:nrensen,项目名称:thebuggenie,代码行数:23,代码来源:Main.php

示例4: image_tag

<div id="client_<?php 
echo $client->getID();
?>
">
    <?php 
echo image_tag('client_large.png', array('style' => 'float: left; margin-right: 5px;'));
?>
    <p class="header">
        <?php 
echo link_tag(make_url('client_dashboard', array('client_id' => $client->getId())), $client->getName());
?>
    </p>
    <p class="info">
        <?php 
echo __('%number_of member(s)', array('%number_of' => '<span id="client_' . $client->getID() . '_membercount">' . $client->getNumberOfMembers() . '</span>'));
?>
,
        <?php 
echo __('%number_of projects(s)', array('%number_of' => '<span id="client_' . $client->getID() . '_projectcount">' . count(\thebuggenie\core\entities\Project::getAllByClientID($client->getID())) . '</span>'));
?>
     </p>
</div>
开发者ID:nrensen,项目名称:thebuggenie,代码行数:22,代码来源:_client.inc.php


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