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