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