本文整理汇总了PHP中Price::transformaArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Price::transformaArray方法的具体用法?PHP Price::transformaArray怎么用?PHP Price::transformaArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Price
的用法示例。
在下文中一共展示了Price::transformaArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listPrice
public function listPrice($placeApiId, $placeId)
{
$cn = new Conexao();
$prices = array();
if ($placeApiId != null && $placeId == null) {
$sql = "SELECT id, name, description, price FROM prices_added WHERE place_api_id like '" . $placeApiId . "'";
$result = $cn->execute($sql);
if ($result != false) {
while ($rs = mysql_fetch_array($result)) {
$price = new Price($rs["id"], $rs["name"], $rs["description"], $rs["price"], null, $placeApiId);
array_push($prices, $price->transformaArray());
}
$cn->disconnect();
return $prices;
} else {
$cn->disconnect();
return false;
}
} else {
if ($placeApiId == null && $placeId != null) {
$sql = "SELECT id, name, description, price FROM prices_added WHERE place_id = " . $placeId . "";
$places = array();
$result = $cn->execute($sql);
if ($result != false) {
while ($rs = mysql_fetch_array($result)) {
$price = new Price($rs["id"], $rs["name"], $rs["description"], $rs["price"], $placeId, null);
array_push($prices, $price->transformaArray());
}
$cn->disconnect();
return $prices;
} else {
$cn->disconnect();
return false;
}
}
}
}