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