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


PHP Item::getAll方法代码示例

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


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

示例1: get_items

function get_items()
{
    global $smarty, $fpdo;
    $oItem = new Item($fpdo);
    $items_results = $oItem->getAll();
    $smarty->assign('items', $items_results);
    $smarty->display('showitems.tpl');
}
开发者ID:MattCouv,项目名称:dev.batata.fr,代码行数:8,代码来源:controllers.php

示例2: 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

示例3: find

 static function find($found_id)
 {
     $found_item = null;
     $items = Item::getAll();
     foreach ($items as $item) {
         $id = $item->getId();
         if ($id == $found_id) {
             $found_item = $item;
         }
     }
     return $found_item;
 }
开发者ID:ben-pritchard,项目名称:inventory-PHP-databases,代码行数:12,代码来源:item.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: foreach

if ($storeid) {
    $store->read($storeid);
}
include 'inc/widget/error.php';
?>

<form action="" method="post">
	<table class="form">
	<tr>
		<td class="label">Nombre:</td>
		<td>
			<?php 
if ($itemid) {
    echo "<input type='hidden' name='itemid' value='{$itemid}'/><span>{$item->name}, {$item->type}</span>";
} else {
    $items = Item::getAll("name", "");
    echo "<select name='itemid' id='items'>";
    echo "<option value=''>-Seleccione-</option>";
    foreach ($items as $item) {
        echo "<option value='{$item->id}'>{$item->name}, {$item->type}</option>";
    }
    echo "</select>";
}
?>
		</td>
	</tr>
	<tr>
		<td class="label">Cajas:</td>
		<td><input name="box" type="text" onchange="multiplicar()" id="box" value="" size="20"/> <span class="mandatory">*</span> </td>
	</tr>
	<tr>
开发者ID:BackupTheBerlios,项目名称:rinventory-svn,代码行数:31,代码来源:lot_new.php

示例8: testDelete

 function testDelete()
 {
     //Arrange
     $description = "Pliny the Elder";
     $cost = 5.0;
     $id = null;
     $test_item = new Item($description, $cost, $id);
     $test_item->save();
     $description2 = "Lagunitas IPA";
     $cost2 = 7.0;
     $test_item2 = new Item($description2, $cost2, $id);
     $test_item2->save();
     //Act
     $test_item->delete();
     $result = Item::getAll();
     //Assert
     $this->assertEquals($test_item2, $result[0]);
 }
开发者ID:kellimargaret,项目名称:Beer-Me,代码行数:18,代码来源:ItemTest.php

示例9: testDeleteAssociatedItems

 function testDeleteAssociatedItems()
 {
     $collection_name = "Star Wars Cards";
     $test_collection = new Collection($collection_name);
     $test_collection->save();
     $collection_id = $test_collection->getId();
     $item_name = "Boba Fett";
     $test_item = new Item($item_name, $collection_id);
     $test_item->save();
     $item_name2 = "Slave 1";
     $test_item2 = new Item($item_name2, $collection_id);
     $test_item2->save();
     // Act
     $test_collection->deleteAssociatedItems();
     // Assert
     $this->assertEquals([], Item::getAll());
 }
开发者ID:ben-pritchard,项目名称:inventory-PHP-databases,代码行数:17,代码来源:collectionTest.php

示例10: PDO

<?php

require_once __DIR__ . "/../vendor/autoload.php";
require_once __DIR__ . "/../src/Item.php";
$app = new Silex\Application();
$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');
});
$app->post("/delete_items", function () use($app) {
    Item::deleteAll();
    return $app['twig']->render('index.html.twig');
});
$app->post("/inventory", function () use($app) {
    $item = new Item("id", $_POST['name']);
    $item->save();
    return $app['twig']->render("index.html.twig", array("item" => Item::getAll()));
});
return $app;
开发者ID:bdspen,项目名称:Inventory_Database,代码行数:23,代码来源:app.php

示例11: Page

	$page = new Page(0, "OrderUp - Reporting");
	$tmpl = new Template();
	
	$userid = $_SESSION['userid'];

	//set breadcrumb
	$report_type = isset($_GET['report']) ? $_GET['report'] : null;
	$bc = new Breadcrumb('report', $report_type);
	$tmpl->breadcrumb = $bc->path;
	$tmpl->report_type = $report_type;
	$page->run();
	

	//get all items
	$items = array();
	$items = Item::getAll();
	$tmpl->items = $items;
	
	$item_counts = array();
	
	//get all item counts
	foreach($items as $item)
	{
		$item_counts[$item->itemid] = Order_Item::getOrderCount($item->itemid);
	}
	
	$tmpl->item_counts = $item_counts;

	$order_times = array();
	
	//push active orders
开发者ID:rockerest,项目名称:capstone,代码行数:31,代码来源:reporting.php

示例12: PDO

<?php

require_once __DIR__ . "/../vendor/autoload.php";
require_once __DIR__ . "/../vendor/autoload.php";
$app = new Silex\Application();
$server = 'mysql:host=localhost;dbname=market';
$username = 'root';
$password = 'root';
$DB = new PDO($server, $username, $password);
$app->register(new Silex\Prodiver\TwigServerProvider(), array('twig.path' => __DIR__ . '/../views'));
$app->get("/", function () use($app) {
    return $app['twig']->render('inventory.html.twig', array('items' => Item::getAll()));
});
开发者ID:bjkropff,项目名称:market_app,代码行数:13,代码来源:app.php


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