本文整理匯總了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>