public function testDefaultModelBindingStillWorks() { $model = Real::create([]); $expected = url('real/' . $model->getRouteKey()); $actual = route('real', ['real' => $model]); $this->assertEquals($expected, $actual); }
/** * {@inheritdoc} */ public function divInteger(Integer $x) { $value = $this->divSpecialCases($x); if ($value !== null) { return $value; } return Real::fromNative($this->toNative() / $x->toNative()); }
/** * {@inheritdoc} */ public function powReal(Real $x) { return self::fromNative(\pow($this->toNative(), $x->toNative())); }
/** * {@inheritdoc} */ public function divReal(Real $x) { return $this->divDecimal($x->toDecimal()); }
public function deleteAction() { $products = Real::findFirst($this->dispatcher->getParams("id")); $auth = $this->session->get('auth'); $profile = $auth['id']; $get_id = $products->user_id; if ($profile != $get_id) { $this->flash->error("Нет прав удаления!"); $this->view->prof_user = false; } else { $this->view->prof_user = true; $this->view->id = $this->dispatcher->getParams("id"); if ($products->delete() == false) { foreach ($products->getMessages() as $message) { $this->flash->error((string) $message); } } else { $this->flash->success('Данные успешно удалены'); } } }
<?php require_once 'Interface.php'; class Real implements Inter { public function real() { return 'real'; } } $d = new Real(); echo $d->real();