本文整理匯總了PHP中type::create方法的典型用法代碼示例。如果您正苦於以下問題:PHP type::create方法的具體用法?PHP type::create怎麽用?PHP type::create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類type
的用法示例。
在下文中一共展示了type::create方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: store
/**
*
* @param Request $request
* @return type
*/
public function store(Request $request)
{
$produto = $this->service->create($request->all());
if ($produto['error']) {
return redirect($this->url)->with("danger", $produto['messege']);
}
return redirect($this->url)->with("success", "Produto cadastrado!");
}
示例2: store
/**
*
* @param Request $request
* @return type
*/
public function store(Request $request)
{
$cliente = $this->service->create($request->all());
if ($cliente['error']) {
return redirect($this->url)->with("danger", $cliente['messege']);
}
return redirect($this->url)->with("success", "Fornecedor cadastrado!");
}
示例3: create
/**
*
* @param array $data
* @return type
*/
public function create(array $data)
{
try {
$this->validator->with($data)->passesOrFail();
return $this->repository->create($data);
} catch (ValidatorException $e) {
return ['error' => 'true', 'messege' => $e->getMessageBag()];
}
}
示例4: add
/**
* Create new Content and redirect to edit controller.
*
* @param type $parent
*/
public function add($parent = null)
{
$content_id = $this->Content->create(['content_type' => $this->type_id]);
if (intval($content_id) > 0) {
$this->redirect(['action' => 'edit', $content_id]);
} else {
exit(__('Error! Unable to create the content.'));
}
}
示例5: store
/**
*
* @param Request $request
* @return type
*/
public function store(Request $request)
{
return $this->service->create($request->all());
}
示例6: checkEMConnection
/**
* check current em and if no connection
* recreate
* @param type $em
* @return type
*/
protected function checkEMConnection($em)
{
if (!$em->isOpen()) {
$connection = $em->getConnection();
$config = $em->getConfiguration();
return $em->create($connection, $config);
}
}