本文整理汇总了PHP中Reports::setName方法的典型用法代码示例。如果您正苦于以下问题:PHP Reports::setName方法的具体用法?PHP Reports::setName怎么用?PHP Reports::setName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reports
的用法示例。
在下文中一共展示了Reports::setName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
<?php
include dirname(__FILE__) . '/../../bootstrap/Doctrine.php';
$t = new lime_test(4, new lime_output_color());
$u = Doctrine::getTable('Users')->getUserByPassword("root", "evil");
$reports = Doctrine::getTable('Reports')->getTaskReports();
$t->is(count($reports), 0, '"0" Tasks report available');
$report = new Reports();
$report->setParameters(array('name' => 'annual_stat_collection', 'collection_ref' => 1, 'date_from' => '01-01-2000', 'date_to' => '31-12-2012'));
$report->setUserRef($u->getId());
$report->setName('annual_stat_collection');
$report->setLang('en');
$report->setFormat('pdf');
$report->save();
$reports = Doctrine::getTable('Reports')->getTaskReports();
$t->is(count($reports), 1, '"1" Task report available');
$reports = Doctrine::getTable('Reports')->getUserReport($u->getId());
$t->is(count($reports), 1, '"1" report available for user "' . $u->getGivenName() . '"');
foreach ($reports as $report) {
$t->is($report->getParameters()->count(), 3, '"3" parameters (collection_ref,date_from,date_to) set for "' . $report->getName() . '"');
}
示例2: generateReport
function generateReport()
{
$code = $this->generatePass();
$now = Carbon::Now();
$clients = isset($_GET["clients"]) ? $_GET["clients"] : null;
$name = isset($_GET["name"]) ? $_GET["name"] : "";
$periodFrom = isset($_GET["periodFrom"]) ? $_GET["periodFrom"] : null;
$periodTo = isset($_GET["periodTo"]) ? $_GET["periodTo"] : null;
if (is_null($clients)) {
echo "Nepavyko nuskaityti parametro!";
return;
}
$reports = new Reports();
$reports->setName($name);
$reports->setCode($code);
$reports->setClients($clients);
$reports->setOwner(9);
$reports->setPeriod_from($periodFrom);
$reports->setPeriod_to($periodTo);
$reports->setAdd_date($now->toDateTimeString());
$rez = $this->reportsDao->insert($reports);
if (is_string($rez)) {
echo "-1";
return;
}
$fullUrl = $this->reportsUrl . $code;
//$return = '<span style="font-size: 12px; font-weight: bold;">Ataskaitos adresas</span><br /><div class="well well-sm">'.$fullUrl.'</div>';
$return = '<span style="font-size: 12px; font-weight: bold;">Ataskaitos adresas</span><br /><input type="text" class="form-control" id="exampleInputEmail1" value="' . $fullUrl . '" onclick="this.select(); document.execCommand(\'copy\');">';
echo $return;
}
示例3: find
function find($criteria = null, $order = null, $limit = 1000, $from = 0)
{
$result = $this->database->query($this->buildFindQuery($criteria, $order, $limit, $from));
if (!is_null($result->getError())) {
return $result->getError();
}
$reportss = array();
while ($row = $result->fetchRow()) {
$reports = new Reports();
$value = $row[0];
$reports->setId($value);
$value = $row[1];
$reports->setName($value);
$value = $row[2];
$reports->setCode($value);
$value = $row[3];
$reports->setClients($value);
$value = $row[4];
$reports->setOwner($value);
$value = $row[5];
$reports->setPeriod_from($value);
$value = $row[6];
$reports->setPeriod_to($value);
$value = $row[7];
$reports->setAdd_date($value);
if ($order != null) {
array_push($reportss, $reports);
} else {
$reportss[$reports->getId()] = $reports;
}
}
return $reportss;
}