本文整理匯總了PHP中LogActions::RowToObject方法的典型用法代碼示例。如果您正苦於以下問題:PHP LogActions::RowToObject方法的具體用法?PHP LogActions::RowToObject怎麽用?PHP LogActions::RowToObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類LogActions
的用法示例。
在下文中一共展示了LogActions::RowToObject方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Search
function Search($num_rec_per_page = 0, $page = 1)
{
$this->MakeSafe();
// This will store all our extended sql
$sqlextend = "";
foreach ($this as $prop => $val) {
if ($val && $val != date("Y-m-d", strtotime(0))) {
extendsql($prop, $val, $sqlextend, true);
}
}
$sqlextend .= " ORDER BY Time DESC";
// Make sure someone didn't do something crazy with the input
$page = intval($page);
$num_rec_per_page = intval($num_rec_per_page);
if ($page && $num_rec_per_page) {
$start_from = ($page - 1) * $num_rec_per_page;
$sqlextend .= " LIMIT {$start_from}, {$num_rec_per_page}";
}
$sql = "SELECT * FROM fac_GenericLog{$sqlextend};";
$events = array();
foreach ($this->query($sql) as $dbRow) {
$events[] = LogActions::RowToObject($dbRow);
}
return $events;
}
示例2: Search
function Search($num_rec_per_page = 0, $page = 1)
{
$this->MakeSafe();
// This will store all our extended sql
$sqlextend = "";
function findit($prop, $val, &$sql)
{
if ($sql) {
$sql .= " AND {$prop}=\"{$val}\"";
} else {
$sql .= " WHERE {$prop} LIKE \"%{$val}%\"";
}
}
foreach ($this as $prop => $val) {
if ($val && $val != "1969-12-31") {
findit($prop, $val, $sqlextend);
}
}
$sqlextend .= " ORDER BY Time DESC";
// Make sure someone didn't do something crazy with the input
$page = intval($page);
$num_rec_per_page = intval($num_rec_per_page);
if ($page && $num_rec_per_page) {
$start_from = ($page - 1) * $num_rec_per_page;
$sqlextend .= " LIMIT {$start_from}, {$num_rec_per_page}";
}
$sql = "SELECT * FROM fac_GenericLog{$sqlextend};";
$events = array();
foreach ($this->query($sql) as $dbRow) {
$events[] = LogActions::RowToObject($dbRow);
}
return $events;
}