本文整理汇总了PHP中Chart::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Chart::getId方法的具体用法?PHP Chart::getId怎么用?PHP Chart::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chart
的用法示例。
在下文中一共展示了Chart::getId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setChartRelatedByForkedFrom
/**
* Declares an association between this object and a Chart object.
*
* @param Chart $v
* @return Chart The current object (for fluent API support)
* @throws PropelException
*/
public function setChartRelatedByForkedFrom(Chart $v = null)
{
if ($v === null) {
$this->setForkedFrom(NULL);
} else {
$this->setForkedFrom($v->getId());
}
$this->aChartRelatedByForkedFrom = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the Chart object, it will not be re-added.
if ($v !== null) {
$v->addChartRelatedById($this);
}
return $this;
}
示例2: addInstanceToPool
/**
* Adds an object to the instance pool.
*
* Propel keeps cached copies of objects in an instance pool when they are retrieved
* from the database. In some cases -- especially when you override doSelect*()
* methods in your stub classes -- you may need to explicitly add objects
* to the cache in order to ensure that the same objects are always returned by doSelect*()
* and retrieveByPK*() calls.
*
* @param Chart $obj A Chart object.
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
*/
public static function addInstanceToPool($obj, $key = null)
{
if (Propel::isInstancePoolingEnabled()) {
if ($key === null) {
$key = (string) $obj->getId();
}
// if key === null
ChartPeer::$instances[$key] = $obj;
}
}
示例3: prune
/**
* Exclude object from result
*
* @param Chart $chart Object to remove from the list of results
*
* @return ChartQuery The current query, for fluid interface
*/
public function prune($chart = null)
{
if ($chart) {
$this->addUsingAlias(ChartPeer::ID, $chart->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
示例4: filterByChart
/**
* Filter the query by a related Chart object
*
* @param Chart|PropelObjectCollection $chart The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return JobQuery The current query, for fluid interface
* @throws PropelException - if the provided filter is invalid.
*/
public function filterByChart($chart, $comparison = null)
{
if ($chart instanceof Chart) {
return $this->addUsingAlias(JobPeer::CHART_ID, $chart->getId(), $comparison);
} elseif ($chart instanceof PropelObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this->addUsingAlias(JobPeer::CHART_ID, $chart->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByChart() only accepts arguments of type Chart or PropelCollection');
}
}
示例5: Chart
$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());
$fs->touch($path);
$t->cmp_ok(file_exists($path), '===', true, 'A Chart may have an associated figure file.');
$g->delete();
$g2 = Doctrine_Core::getTable('Chart')->findOneById($id);
$t->cmp_ok($g2, '===', false, '->delete() deletes the chart from the DB');
$t->cmp_ok(file_exists($path), '===', false, '->delete() also deletes the image associated to the Chart');