當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。