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


PHP Doctrine_Collection::delete方法代码示例

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


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

示例1: testMultiplePrimaryKeys

 public function testMultiplePrimaryKeys()
 {
     $r = new Doctrine_Collection('NestReference');
     $r[0]->parent_id = 1;
     $r[0]->child_id = 2;
     $r[1]->parent_id = 2;
     $r[1]->child_id = 3;
     $r->save();
     $r->delete();
     $this->conn->clear();
     $q = new Doctrine_Query();
     $coll = $q->from('NestReference')->execute();
     $this->assertEqual(count($coll), 0);
 }
开发者ID:kaakshay,项目名称:audience-insight-repository,代码行数:14,代码来源:CircularSavingTestCase.php

示例2: delete

 /**
  * @see Doctrine_Collection::delete()
  * @return Doctrine_Collection_Cachetaggable
  */
 public function delete(Doctrine_Connection $conn = null, $clearColl = true)
 {
     $returnValue = parent::delete($conn, $clearColl);
     $this->removeCacheTags();
     return $returnValue;
 }
开发者ID:uniteddiversity,项目名称:policat,代码行数:10,代码来源:Cachetaggable.php

示例3: SortableArticle

$t->info('Test "moveToPosition" method');
$a4 = new SortableArticle();
$a4->name = 'Fourth Article';
$a4->save();
$t->is($a4['position'], 3, 'The new article is placed at the end');
$a4->moveToPosition(1);
doctrine_refresh($a1);
$t->is($a1['position'], 3, 'The 2nd-positioned item has been bumped up');
$t->info('Test deleting a collection of sortable items');
$d1 = new SortableArticle();
$d1->name = 'Article To Delete 1';
$d1->save();
$d2 = new SortableArticle();
$d2->name = 'Article To Delete 2';
$d2->save();
$d3 = new SortableArticle();
$d3->name = 'Article To Delete 3';
$d3->save();
$d4 = new SortableArticle();
$d4->name = 'Article To Delete 4';
$d4->save();
$collection = new Doctrine_Collection('SortableArticle');
$collection[] = $d1;
$collection[] = $d2;
$collection[] = $d3;
$collection[] = $d4;
$collection->delete();
$t->ok(!$d1->exists(), '"Article To Delete 1" has been removed');
$t->ok(!$d2->exists(), '"Article To Delete 2" has been removed');
$t->ok(!$d3->exists(), '"Article To Delete 3" has been removed');
$t->ok(!$d4->exists(), '"Article To Delete 4" has been removed');
开发者ID:kipit,项目名称:csDoctrineActAsSortablePlugin,代码行数:31,代码来源:SortableTest.php


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