本文整理匯總了PHP中Store::create方法的典型用法代碼示例。如果您正苦於以下問題:PHP Store::create方法的具體用法?PHP Store::create怎麽用?PHP Store::create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Store
的用法示例。
在下文中一共展示了Store::create方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
DB::table('stores')->delete();
Store::create(array('name' => 'MyStore'));
}
示例2: Store
<?php
require_once "../initialize.php";
$message = "";
if (isset($_POST['name']) && $_POST['name'] != "" && isset($_POST['address']) && $_POST['address'] != "") {
$object = new Store();
$object->name = $_POST['name'];
$object->branchname = $_POST['branchname'];
$object->address = $_POST['address'];
$object->longitude = $_POST['longitude'];
$object->latitude = $_POST['latitude'];
$object->telnum = $_POST['telnum'];
$object->deliverynum = $_POST['deliverynum'];
$object->email = $_POST['email'];
$object->storetypeid = $_POST['storetypeid'];
$object->facebookid = $_POST['facebookid'];
$object->twitterid = $_POST['twitterid'];
$object->pending = $_POST['pending'];
$object->enabled = $_POST['enabled'];
if (isset($_FILES['picture'])) {
$file = new File($_FILES['picture']);
$object->picture = $file->data;
}
$object->create();
//$log = new Log($session->userid, $clientip, "WEB", "CREATED STORE: ".$object->id); $log->create();
$message .= "success";
} else {
$message = "You have missed a required field.";
}
echo $message;
示例3: createNewStore
private function createNewStore()
{
$faker = $this->getFakeGenerator();
Store::create(array('name' => $faker->company, 'phone_number' => $faker->phoneNumber, 'street' => $faker->streetAddress, 'postcode' => $faker->postcode, 'city' => $faker->city));
}