本文整理匯總了PHP中Transfer::setCreatedAt方法的典型用法代碼示例。如果您正苦於以下問題:PHP Transfer::setCreatedAt方法的具體用法?PHP Transfer::setCreatedAt怎麽用?PHP Transfer::setCreatedAt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Transfer
的用法示例。
在下文中一共展示了Transfer::setCreatedAt方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: retrieveByClient
static public function retrieveByClient($status, $client_id = null)
{
//echo $status;
$types= array('all','sell','purchase','switch');
$statuses= array('all','pending','completed','cancelled');
if(!in_array($status,$statuses))
if(!in_array($status,$types))
die('Wrong status when getting transfer collection!');
$IsTypeOriented = in_array($status,$statuses) ? false: true;
if(!$client_id)
die('Should add case for all clients!');
$transactions= array();
if($IsTypeOriented)
$addition = ($status!= 'all') ? " AND types = '$status'" : "";
else
$addition = ($status!= 'all') ? " AND status = '$status'" : "";
$query = " SELECT t.id, t.created_at, t.comment, a.name aname, i.fund_name name,
i.ISIN code, t.status, t.types, t.amount, t.trade_date, t.settlement_date
FROM transfers t, custody_ac a, fund i
WHERE t.id_client = '$client_id' AND a.id = t.id_custody1 AND i.id = t.id_isin $addition ";
$qres=mysql_query($query) or die(mysql_error());
while($row=mysql_fetch_assoc($qres))
{
$transfer = new Transfer();
$transfer->setId($row['id']);
$transfer->setStatus($row['status']);
$transfer->setType($row['types']);
$transfer->setComment($row['comment']);
$transfer->setSecurity($row['name']);
$transfer->setAmount($row['amount']);
$transfer->setIsin($row['code']);
$transfer->setTradeDate($row['trade_date']);
$transfer->setSettlementDate($row['settlement_date']);
$transfer->setAccount($row['aname']);
$transfer->setCreatedAt($row['created_at']);
$transfers[] = $transfer;
}
return $transfers;
}