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