本文整理匯總了PHP中Repository::store方法的典型用法代碼示例。如果您正苦於以下問題:PHP Repository::store方法的具體用法?PHP Repository::store怎麽用?PHP Repository::store使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Repository
的用法示例。
在下文中一共展示了Repository::store方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testStoringDocuments
public function testStoringDocuments()
{
if (!is_dir('/tmp/flywheel')) {
mkdir('/tmp/flywheel');
}
$config = new Config('/tmp/flywheel');
$repo = new Repository('_pages', $config);
for ($i = 0; $i < 5; $i++) {
$data = array('id' => $i, 'slug' => '123', 'body' => 'THIS IS BODY TEXT');
$document = new Document($data);
$repo->store($document);
$name = $i . '_' . sha1($i) . '.json';
$this->assertSame($data, (array) json_decode(file_get_contents('/tmp/flywheel/_pages/' . $name)));
}
}
示例2: store
/**
* Store Project
*
* Create new project entry
*
* @returns Illuminate response (JSON & HTTP code)
*/
public function store(Request $request)
{
return $this->pageRepository->store(new Page(), $request);
}
示例3: store
/**
* Store Tag
*
* Create new project entry
*
* @returns Illuminate response (JSON & HTTP code)
*/
public function store(Request $request)
{
return $this->tagRepository->store(new Tag(), $request);
}
示例4: store
/**
* Store Project
*
* Create new project entry
*
* @returns Illuminate response (JSON & HTTP code)
*/
public function store(Request $request)
{
return $this->projectRepository->store(new Project(), $request);
}
示例5: store
/**
* Store Project
*
* Create new project entry
*
* @returns Illuminate response (JSON & HTTP code)
*/
public function store(Request $request)
{
return $this->restfulRepository->store(new Section(), $request);
}