本文整理汇总了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();
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
示例7: tearDown
protected function tearDown()
{
Item::deleteAll();
}
示例8: tearDown
protected function tearDown()
{
Collection::deleteAll();
Item::deleteAll();
}