本文整理汇总了PHP中Doctrine_Record::getOid方法的典型用法代码示例。如果您正苦于以下问题:PHP Doctrine_Record::getOid方法的具体用法?PHP Doctrine_Record::getOid怎么用?PHP Doctrine_Record::getOid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doctrine_Record
的用法示例。
在下文中一共展示了Doctrine_Record::getOid方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initRelated
public function initRelated(Doctrine_Record $record, $name)
{
if (!isset($this->_initializedRelations[$record->getOid()][$name])) {
$relation = $record->getTable()->getRelation($name);
$coll = new Doctrine_Collection($relation->getTable()->getComponentName());
$coll->setReference($record, $relation);
$record[$name] = $coll;
$this->_initializedRelations[$record->getOid()][$name] = true;
}
return true;
}
示例2: collect
/**
* @see Doctrine_Connection_UnitOfWork::_collectDeletions() copy&past from
*
* @param Doctrine_Record $record
* @param array $definitions
* @return null
*/
private function collect(Doctrine_Record $record, &$definitions)
{
if (!$record->exists()) {
return;
}
if (!$record->getTable()->hasTemplate(sfCacheTaggingToolkit::TEMPLATE_NAME)) {
return;
}
# delete definitions
if ($this->tagNamesToDelete === $definitions) {
$definitions[$record->getOid()] = $record->obtainTagName();
$this->cascade($record);
} else {
# do not call cascade - due to SET NULL only updates columns
# do not add tag, if its already on deletion list
if (!array_key_exists($record->getOid(), $this->tagNamesToDelete)) {
$definitions[$record->getOid()] = $record->obtainTagName();
}
}
}
示例3: compareRecords
/**
* Compares two records. To be used on _snapshot diffs using array_udiff
*
* @param Doctrine_Record $a
* @param Doctrine_Record $b
* @return integer
*/
protected function compareRecords($a, $b)
{
if ($a->getOid() == $b->getOid()) {
return 0;
}
return $a->getOid() > $b->getOid() ? 1 : -1;
}
示例4: _collectDeletions
/**
* Collects all records that need to be deleted by applying defined
* application-level delete cascades.
*
* @param array $deletions Map of the records to delete. Keys=Oids Values=Records.
*/
private function _collectDeletions(Doctrine_Record $record, array &$deletions)
{
if (!$record->exists()) {
return;
}
$deletions[$record->getOid()] = $record;
$this->_cascadeDelete($record, $deletions);
}
示例5: _collectDeletions
/**
* Collects all records that need to be deleted by applying defined
* application-level delete cascades.
*
* @param array $deletions Map of the records to delete. Keys=Oids Values=Records.
*/
private function _collectDeletions(Doctrine_Record $record, array &$deletions)
{
if (!$record->exists()) {
throw new Doctrine_Connection_Exception("Transient records can't be deleted.");
}
$deletions[$record->getOid()] = $record;
$this->_cascadeDelete($record, $deletions);
}