本文整理匯總了PHP中Shop::__SET方法的典型用法代碼示例。如果您正苦於以下問題:PHP Shop::__SET方法的具體用法?PHP Shop::__SET怎麽用?PHP Shop::__SET使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Shop
的用法示例。
在下文中一共展示了Shop::__SET方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Obtain
public function Obtain($id_shop)
{
try {
$query = $this->pdo->prepare('SELECT * FROM Tiendas WHERE id_shop = ?');
$query->execute(array($id_shop));
$r = $query->fetch(PDO::FETCH_OBJ);
$shop = new Shop();
$shop->__SET('id_shop', $r->id_shop);
$shop->__SET('name', $r->name);
$shop->__SET('description', $r->description);
$shop->__SET('tel_number', $r->tel_number);
$shop->__SET('iframe', $r->iframe);
$shop->__SET('image', $r->image);
$shop->__SET('active', $r->active);
return $shop;
} catch (Exception $e) {
die($e->getMessage());
}
}
示例2: alert
echo "<script type=\"text/javascript\">
alert('Se ha añadido correctamente a la base de datos una nueva noticia');
history.go(-2);
</script>";
exit;
}
}*/
if (isset($_REQUEST['action'])) {
//echo "<script type=\"text/javascript\">
// alert('Comprobando valores...');
// </script>";
switch ($_REQUEST['action']) {
case 'update':
//$shop->__SET('id_shop' , $_REQUEST['id_shop']);
$shop->__SET('name', $_REQUEST['name']);
$shop->__SET('description', $_REQUEST['description']);
$shop->__SET('tel_number', $_REQUEST['tel_number']);
$shop->__SET('iframe', $_REQUEST['iframe']);
$shop->__SET('image', $_REQUEST['image']);
$shop->__SET('active', $_REQUEST['active']);
$shopModel->Update($shop);
echo "<script type=\"text/javascript\">\n alert('¡El registro se ha actualizado exitosamente!');\n history.go(-2);\n </script>";
break;
case 'insert':
//$shop->__SET('id_shop' , $_REQUEST['id_shop']);
$shop->__SET('name', $_REQUEST['name']);
$shop->__SET('description', $_REQUEST['description']);
$shop->__SET('tel_number', $_REQUEST['tel_number']);
$shop->__SET('iframe', $_REQUEST['iframe']);
$shop->__SET('image', $_REQUEST['image']);