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