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


PHP Organization::getExportableIssues方法代码示例

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


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

示例1: Resource

<?php

session_start();
include_once 'directory.php';
$resourceID = $_GET['resourceID'];
$archivedFlag = !empty($_GET['archived']) && $_GET['archived'] == 1 ? true : false;
$resource = new Resource(new NamedArguments(array('primaryKey' => $resourceID)));
$util = new Utility();
$organizationArray = $resource->getOrganizationArray();
$exportIssues = array();
if (count($organizationArray) > 0) {
    $issuedOrgs = array();
    foreach ($organizationArray as $orgData) {
        if (!in_array($orgData['organizationID'], $issuedOrgs)) {
            // todo: create issues repo so we don't have to initialize an organization object from the wrong module
            $organization = new Organization(new NamedArguments(array('primaryKey' => $orgData['organizationID'])));
            $exportIssues = array_merge($exportIssues, $organization->getExportableIssues($archivedFlag));
            $issuedOrgs[] = $orgData['organizationID'];
        }
    }
}
$exportIssues = array_merge($exportIssues, $resource->getExportableIssues($archivedFlag));
header("Pragma: public");
header("Content-type: text/csv");
header("Content-Disposition: attachment; filename=\"issues.csv\"");
$out = fopen('php://output', 'w');
fputcsv($out, array_keys($exportIssues[0]));
foreach ($exportIssues as $issue) {
    fputcsv($out, $issue);
}
fclose($out);
开发者ID:jcraitz,项目名称:resources,代码行数:31,代码来源:export_issues.php

示例2: Organization

<?php

session_start();
include_once 'directory.php';
$organizationID = $_GET['organizationID'];
$archivedFlag = !empty($_GET['archived']) && $_GET['archived'] == 1 ? true : false;
$organization = new Organization(new NamedArguments(array('primaryKey' => $organizationID)));
$exportIssues = array();
$exportIssues = $organization->getExportableIssues($archivedFlag);
header("Pragma: public");
header("Content-type: text/csv");
header("Content-Disposition: attachment; filename=\"issues.csv\"");
if (count($exportIssues) > 0) {
    ob_clean();
    $out = fopen('php://output', 'w');
    fputcsv($out, array_keys($exportIssues[0]));
    foreach ($exportIssues as $issue) {
        fputcsv($out, $issue);
    }
    fclose($out);
}
开发者ID:pontifechs,项目名称:organizations,代码行数:21,代码来源:export_resourceissues.php


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