本文整理汇总了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);
示例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);
}