本文整理汇总了PHP中Item::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Item::all方法的具体用法?PHP Item::all怎么用?PHP Item::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Item
的用法示例。
在下文中一共展示了Item::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editPackage
/**
* @before _secure, _vendor
*/
public function editPackage($package_id)
{
$this->seo(array("title" => "Edit Packages", "view" => $this->getLayoutView()));
$view = $this->getActionView();
$package = Package::first(array("id = ?" => $package_id, "organization_id = ?" => $this->organization->id));
if (!$package) {
$this->redirect("/vendor");
}
$tests = Test::all(array(), array("id", "title"));
$items = Item::all(array("package_id = ?" => $package->id));
$sorted = array();
foreach ($items as $i) {
$sorted[$i->test_id] = $i;
}
$fields = $package->render();
$errors = array();
$view->set("fields", $fields);
if (RequestMethods::post("action") == "savePackage") {
foreach ($fields as $f) {
$package->{$f}['name'] = RequestMethods::post($f['name']);
}
if ($package->validate()) {
$package->save();
$view->set("message", "Package Saved Successfully");
} else {
$errors = $package->errors;
}
$sorted = $this->_saveTests($package, $sorted);
}
$view->set("package", $package)->set("items", $sorted)->set("tests", $tests)->set("errors", $errors);
}
示例2: index
public static function index()
{
// Haetaan kaikki vaatteet tietokannasta
$items = Item::all();
// Renderöidään views/item kansiossa sijaitseva tiedosto index.html muuttujan $items datalla
View::make('items/index.html', array('items' => $items));
}
示例3: index
/**
* Display a listing of items
*
* @return Response
*/
public function index()
{
$items = Item::all();
$categories = Category::all();
$item = new Item();
return View::make('items.index', compact('items', 'categories', 'item'));
}
示例4: edit
/**
* Show the form for editing the specified order.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
$items = Item::all();
$customers = Client::all();
$order = Order::findOrFail($id);
return View::make('orders.edit', compact('items', 'customers', 'order'));
}
示例5: stock
public function stock()
{
$items = Item::all();
$organization = Organization::find(1);
$pdf = PDF::loadView('erpreports.stockReport', compact('items', 'organization'))->setPaper('a4')->setOrientation('potrait');
return $pdf->stream('Stock Report.pdf');
}
示例6: displayTask
/**
* Display a list of entries
*
* @return void
*/
public function displayTask()
{
// Get some incoming filters to apply to the entries list
//
// The Request::getState() method makes it easy to retain values of
// certain variables across page accesses. This makes development much
// simpler because we no longer has to worry about losing variable values
// if it is left out of a form. The best example is that the form will
// retain the proper filters even after navigating to the edit entry form
// and back.
$filters = array('search' => urldecode(Request::getState($this->_option . '.' . $this->_controller . '.search', 'search', '')), 'state' => urldecode(Request::getState($this->_option . '.' . $this->_controller . '.state', 'state', -1)), 'sort' => Request::getState($this->_option . '.' . $this->_controller . '.sort', 'filter_order', 'name'), 'sort_Dir' => Request::getState($this->_option . '.' . $this->_controller . '.sortdir', 'filter_order_Dir', 'ASC'));
// Get our model
// This is the entry point to the database and the
// table of entries we'll be retrieving data from
$modeld = Item::all();
if ($filters['state'] >= 0) {
$record->whereEquals('state', $filters['state']);
}
if ($search = $filters['search']) {
$record->whereLike('name', $search);
}
$rows = $record->ordered('filter_order', 'filter_order_Dir')->paginated()->rows();
// Output the view
$this->view->set('rows', $rows)->set('filters', $filters)->display();
}
示例7: create
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
//
$newId = Itemset::generateId();
$items = Item::all();
return View::make('itemset.new', ['id' => $newId, 'items' => $items]);
}
示例8: manage
/**
* Manage Items
* @before _secure, _admin
*/
public function manage()
{
$this->seo(array("title" => "Items | Manage", "view" => $this->getLayoutView()));
$view = $this->getActionView();
$count = Item::count();
$limit = RequestMethods::get("limit", 20);
$page = RequestMethods::get("page", 1);
$items = Item::all(array(), array("id", "name", "price", "tax", "period", "created", "live"), "created", "desc", $limit, $page);
$view->set("count", $count)->set("page", $page)->set("limit", $limit)->set("items", $items);
}
示例9: run
public function run()
{
$items = Item::all();
foreach ($items as $item) {
$i = Item::find($item->id);
if ($item->participant) {
$i->event_id = $item->participant->event_id;
$i->save();
}
if ($item->member) {
$i->team_id = $item->member->team_id;
$i->save();
}
}
}
示例10: getAll
public function getAll($f3)
{
echo json_encode(Item::all());
}
示例11: index
/**
* Display a listing of items
*
* @return Response
*/
public function index()
{
$items = Item::all();
return View::make('items.index', compact('items'));
}
示例12: function
| and give it the Closure to execute when that URI is requested.
|
*/
/* Sample routes */
Route::get('fuck', function () {
return (new ProductionItem())->getUnsoldItems();
return Carbon::now()->addDays(2);
return $item = ProductionItem::where('production_id', '=', '215')->where('item_id', '=', '10037')->where('status', '=', "pending")->first()->id;
return ReportsController::generateSalesByRange();
return View::make('hello');
return Auth::user()->username;
return PDF::loadView('items.barcodes')->setPaper('a6')->setOrientation('landscape')->setWarnings(false)->stream('barcodes.pdf');
});
Route::get('tt', function () {
return Session::get('REGISTER');
$item = Item::all();
return PDF::loadView('items.barcodes')->setPaper('a6')->setOrientation('landscape')->setWarnings(false)->stream('barcodes.pdf');
$prod = new ProductionItem();
$pending = $prod->getPendingItems();
$prod_items = $prod->getCurrentProductionsItemId();
// return $pending[0]->remaining;
foreach ($pending as $item) {
print $item->item_id . " ";
if (in_array($item->item_id, $prod_items)) {
return "pending";
exit;
}
return "not pending";
exit;
}
$invoiceInfo = ['customer' => 'Raymund Santillan', 'total' => 'Php 150.00'];
示例13: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
//
$items = Item::all();
return View::make('item.item', ['items' => $items]);
}
示例14: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$items = Item::all();
return $items;
}
示例15: compact
$locations = Location::all();
$taxes = Tax::all();
return View::make('erporders.orderitems', compact('items', 'locations', 'taxes', 'orderitems'));
});
Route::get('purchaseitems/remove/{id}', function ($id) {
Session::forget('orderitems', $id);
$orderitems = Session::get('orderitems');
$items = Item::all();
$locations = Location::all();
$taxes = Tax::all();
return View::make('erporders.orderitems', compact('items', 'locations', 'taxes', 'orderitems'));
});
Route::get('quotationitems/remove/{id}', function ($id) {
Session::forget('orderitems', $id);
$orderitems = Session::get('orderitems');
$items = Item::all();
$locations = Location::all();
$taxes = Tax::all();
return View::make('erporders.orderitems', compact('items', 'locations', 'taxes', 'orderitems'));
});
Route::resource('stocks', 'StocksController');
Route::resource('erporders', 'ErporderssController');
Route::post('erporder/commit', function () {
$erporder = Session::get('erporder');
$erporderitems = Session::get('orderitems');
$total = Input::all();
// $client = Client: :findorfail(array_get($erporder, 'client'));
// print_r($total);
$order = new Erporder();
$order->order_number = array_get($erporder, 'order_number');
$order->client()->associate(array_get($erporder, 'client'));