本文整理匯總了PHP中v::object方法的典型用法代碼示例。如果您正苦於以下問題:PHP v::object方法的具體用法?PHP v::object怎麽用?PHP v::object使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類v
的用法示例。
在下文中一共展示了v::object方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: postTransfer
public function postTransfer()
{
try {
if ($this->app->session->phrase != $this->app->request->post("captcha")) {
throw new InvalidCustomException("Captcha yang anda masukan salah");
}
$member_from = $this->app->em->find("Mabes\\Entity\\Member", $this->app->request->post("login_from"));
$member_to = $this->app->em->find("Mabes\\Entity\\Member", $this->app->request->post("login_to"));
v::object()->assert($member_from);
v::object()->assert($member_to);
$transfer = new Transfer();
$transfer->massAssignment($this->app->request->post());
$transfer->setFromLogin($member_from);
$transfer->setToLogin($member_to);
$this->app->em->persist($transfer);
$this->app->em->flush();
$this->app->view()->appendData(["isSuccess" => true, "successTitle" => "Success", "successMessage" => "Transfer Request anda sudah kami terima"]);
} catch (AbstractNestedException $e) {
$errors = $e->findMessages(["numeric" => "{{name}} harus berisi numeric", "alnum" => "{{name}} harus berisi alphanumeric", "email" => "{{name}} harus berisi email yang valid", "float" => "{{name}} harus bernilai desimal", "notEmpty" => "Mohon diisi semua field", "equals" => "{{input}} tidak cocok dengan yang ada didatabase", "object" => "no login tidak dapat ditemukan didalam database", "startsWith" => "Nomor telepon harus berawalan dengan +", 'uploaded' => "file upload gagal"]);
$this->validationMessage($errors);
} catch (InvalidCustomException $e) {
$this->validationMessage(["custom" => $e->getMessage()]);
}
$this->app->render('Pages/_transferBalance.twig');
}