本文整理汇总了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));
}