Report::toArray PHP Method

toArray() public method

public toArray ( )
    public function toArray()
    {
        return (array) \Locker\Helpers\Helpers::replaceHtmlEntity(parent::toArray());
    }

Usage Example

Exemplo n.º 1
0
function getReports($filter)
{
    $reports = array();
    if (!is_null($filter)) {
        $db = new Database();
        $sql = "SELECT `id` FROM reports WHERE statusID=?";
        $sql = $db->prepareQuery($sql, $filter);
    } else {
        //not filtered. all reports
        $db = new Database();
        $sql = "SELECT `id` FROM reports";
    }
    $results = $db->select($sql);
    if (is_array($results)) {
        foreach ($results as $result) {
            $newReport = new Report();
            $newReport->fetch($result['id']);
            $reports[] = $newReport->toArray();
        }
    }
    return $reports;
}
All Usage Examples Of Report::toArray