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


PHP Chart::link方法代码示例

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


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

示例1: array

$g->setKilometersTo(12423);
$g->setUserId($ut->getUserId('ruf'));
$g->link('Vehicles', array($ut->getVehicleId('vw-touran-1-4-tsi')));
$g->link('Categories', array($ut->getIdForCategory('Tax')));
$g->save();
$sha1 = $g->getHash();
$t->isa_ok($sha1, 'string', '->save() creates a sha for each chart');
$g->setKilometersFrom(235);
$g->save();
$sha2 = $g->getHash();
$t->cmp_ok($sha1, '!=', $sha2, '->save() The hash field is updated each time the object is changed');
$g = new Chart();
$g->setFormat('png');
$g->setKilometersTo(12423);
$g->setUserId($ut->getUserId('ruf'));
$g->link('Vehicles', array($ut->getVehicleId('vw-touran-1-4-tsi')));
$g->link('Categories', array($ut->getIdForCategory('Fuel')));
$sha = $g->getHash();
$g2 = new Chart();
$g2->setUserId($ut->getUserId('ruf'));
$g->save();
$finalsha = $g->getHash();
$t->isnt($sha, $finalsha, 'When saving the object, ->save() checks that a unique sha is set. If not, a new one is generated.');
// ->delete()
$t->diag('->delete()');
$g = new Chart();
$g->setUserId($ut->getUserId('ruf'));
$g->save();
$id = $g->getId();
$path = $g->getChartFileSystemPath();
$fs = new sfFilesystem(new sfEventDispatcher());
开发者ID:rbolliger,项目名称:otokou,代码行数:31,代码来源:chartTest.php

示例2: saveNewChart

 protected function saveNewChart()
 {
     $chart = new Chart();
     $params = $this->parameters;
     $foreign = array('categories_list' => 'Categories', 'vehicles_list' => 'Vehicles');
     $chart->fromArray($this->parameters);
     foreach ($foreign as $field => $class) {
         if (isset($params[$field])) {
             $chart->link($class, $params[$field]);
         }
     }
     try {
         $chart->save();
     } catch (Exception $exc) {
         $sfe = new sfException();
         throw $sfe->createFromException($exc);
     }
     $this->chart = $chart;
     return $chart;
 }
开发者ID:rbolliger,项目名称:otokou,代码行数:20,代码来源:ChartBuilder.class.php


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