本文整理汇总了PHP中Portfolio::persist方法的典型用法代码示例。如果您正苦于以下问题:PHP Portfolio::persist方法的具体用法?PHP Portfolio::persist怎么用?PHP Portfolio::persist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Portfolio
的用法示例。
在下文中一共展示了Portfolio::persist方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Portfolio
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<?php
require_once 'model.php';
error_reporting(0);
if ($_REQUEST['do'] == "processForm") {
$portfolio = new Portfolio();
$message = $portfolio->buildFromPost();
if ($message == "") {
$message = "Successfully aded portfolio!";
include 'html/green_messagebox.php';
$portfolio->persist();
} else {
include 'html/red_messagebox.php';
}
}
if ($_REQUEST['do'] == 'closeTrade') {
$trade_id = $_POST['trade_id'];
$trade = new Trade($trade_id);
$message = $trade->closeTrade();
if ($message == "") {
$trade->persist();
$message = "Successfully closed trade.";
include 'html/green_messagebox.php';
} else {
include 'html/red_messagebox.php';
}
}
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Portfolios - Kyle Stock Tracker</title>