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


PHP Item::deleteAll方法代码示例

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


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

示例1: tearDown

 protected function tearDown()
 {
     Bar::deleteAll();
     Token::deleteAll();
     Item::deleteAll();
     Patron::deleteAll();
 }
开发者ID:kellimargaret,项目名称:Beer-Me,代码行数:7,代码来源:BarTest.php

示例2: testShouldDeleteAllCorrectly

 public function testShouldDeleteAllCorrectly()
 {
     $this->Item->deleteAll(['Item.id' => [1, 3]]);
     $this->assertEmpty($this->Item->find('all'));
     $this->Item->includeDeletedRecords();
     $item = $this->Item->read(null, 1);
     $this->assertEqual($item['Item']['description'], ItemFixture::DESCR_DELETED);
 }
开发者ID:zunderbolt,项目名称:cakephp-softdelete-trait,代码行数:8,代码来源:ItemTest.php

示例3: test_deleteAll

 function test_deleteAll()
 {
     $name = "Gold Liberty Dollar";
     $name2 = "Bronze My Little Pony: Applejack";
     $test_Item = new Item(null, $name);
     $test_Item->save();
     $test_Item2 = new Item(null, $name2);
     $test_Item2->save();
     Item::deleteAll();
     $result = Item::getAll();
     $this->assertEquals([], $result);
 }
开发者ID:bdspen,项目名称:Inventory_Database,代码行数:12,代码来源:ItemTest.php

示例4: test_deleteAll

 function test_deleteAll()
 {
     //Arrange
     $name = "Hello Kitty";
     $name2 = "Pokemon";
     $test_Item = new Item($name);
     $test_Item->save();
     $test_Item2 = new Item($name2);
     $test_Item2->save();
     //Act
     Item::deleteAll();
     $result = Item::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
开发者ID:Camolot,项目名称:inventory-PHP-databases,代码行数:15,代码来源:itemTest.php

示例5: testDeleteAll

 function testDeleteAll()
 {
     //Arrange
     $collection_name = "Cool stuff";
     $test_collection = new Collection($collection_name);
     $test_collection->save();
     $test_collection_id = $test_collection->getId();
     $name = "Hello Kitty";
     $name2 = "Pokemon";
     $test_item = new Item($name, $test_collection_id);
     $test_item->save();
     $test_item2 = new Item($name2, $test_collection_id);
     $test_item2->save();
     //Act
     Item::deleteAll();
     $result = Item::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
开发者ID:ben-pritchard,项目名称:inventory-PHP-databases,代码行数:19,代码来源:itemTest.php

示例6: PDO

Debug::enable();
$app = new Silex\Application();
// Set Silex debug mode in $app object
$app['debug'] = true;
$server = 'mysql:host=localhost;dbname=inventory';
$username = 'root';
$password = 'root';
$DB = new PDO($server, $username, $password);
$app->register(new Silex\Provider\TwigServiceProvider(), array('twig.path' => __DIR__ . '/../views'));
$app->get('/', function () use($app) {
    return $app['twig']->render('index.html.twig', array('collections' => Collection::getAll(), 'items' => Item::getAll()));
});
$app->post('/collection', function () use($app) {
    $collection = new Collection($_POST['name']);
    $collection->save();
    return $app['twig']->render('index.html.twig', array('collections' => Collection::getAll(), 'items' => Item::getAll()));
});
$app->post('/delete_collections', function () use($app) {
    Collection::deleteAll();
    return $app['twig']->render('index.html.twig', array('collections' => Collection::getAll(), 'items' => Item::getAll()));
});
$app->post('/item', function () use($app) {
    $item = new Item($_POST['name']);
    $item->save();
    return $app['twig']->render('index.html.twig', array('collections' => Collection::getAll(), 'items' => Item::getAll()));
});
$app->post('/delete_items', function () use($app) {
    Item::deleteAll();
    return $app['twig']->render('index.html.twig', array('collections' => Collection::getAll(), 'items' => Item::getAll()));
});
return $app;
开发者ID:Camolot,项目名称:inventory-PHP-databases,代码行数:31,代码来源:app.php

示例7: tearDown

 protected function tearDown()
 {
     Item::deleteAll();
 }
开发者ID:kellimargaret,项目名称:Beer-Me,代码行数:4,代码来源:ItemTest.php

示例8: tearDown

 protected function tearDown()
 {
     Collection::deleteAll();
     Item::deleteAll();
 }
开发者ID:ben-pritchard,项目名称:inventory-PHP-databases,代码行数:5,代码来源:collectionTest.php


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