Habari\LogEntry::get PHP Method

get() public static method

$log= LogEntry::get( array( 'id' => 5 ) );
public static get ( array $paramarray = [] ) : object
$paramarray array An associated array of parameters, or a querystring
return object LogEntry The first log entry that matched the given criteria
    public static function get($paramarray = array())
    {
        // Default parameters.
        $defaults = array('fetch_fn' => 'get_row');
        $user = User::identify();
        if ($user->loggedin) {
            $defaults['where'][] = array('user_id' => $user->id);
        }
        foreach ($defaults['where'] as $index => $where) {
            $defaults['where'][$index] = array_merge($where, Utils::get_params($paramarray));
        }
        // Make sure we fetch only a single event. (LIMIT 1)
        $defaults['limit'] = 1;
        return EventLog::get($defaults);
    }