\CGExtensions\querycsvfileresultset

A class to return records out of a csv file, suitable for using in some reports.

note: it may not be suitable to use a text file in a tabular report.

Summary

Methods
Properties
Constants
RecordCount()
MoveNext()
MoveFirst()
EOF()
Close()
TotalMatches()
get_object()
__construct()
get_query()
MoveLast()
current()
next()
rewind()
key()
valid()
get_pagination()
FetchAll()
getIterator()
Rewind()
$fields
$fields
No constants found
get_fileobject()
wildcard()
_query()
$_rs
$_filter
$_totalmatching
N/A
No private methods found
No private properties found
N/A

Properties

$fields

$fields : string

Get the current record (in this case a line).

Type

string

$fields

$fields : string

Get the current record (in this case a line).

Type

string

$_rs

$_rs

A member to store the database recordset.

$_filter

$_filter

The current filter object.

$_totalmatching

$_totalmatching

The total number of records matching the query (independent of limit and offset)

Methods

RecordCount()

RecordCount() : int

Get the number of records returned in this recordset.

Returns

int

MoveNext()

MoveNext()

Move the pointer to the next matching row in the recordset.

MoveFirst()

MoveFirst()

Move the pointer to the first matching row in the recordset.

EOF()

EOF() : bool

Test if the pointer is at the end of the recordset (there are no more records)

Returns

bool

Close()

Close()

Close the recordset, and free resources.

TotalMatches()

TotalMatches() : int

return the total number of matches (independent of limit and offset)

Returns

int

get_object()

get_object() : object

Get an object representing the data at the current pointer position

Returns

object

MoveLast()

MoveLast()

Move the pointer to the last matching row in the recordset.

current()

current()

next()

next()

rewind()

rewind()

key()

key()

valid()

valid()

get_pagination()

get_pagination() : \CGExtensions\query\pagination

Get a pagination object for this query and resultset

Returns

\CGExtensions\query\pagination

FetchAll()

FetchAll() : object[]

Fetch all of the records in this resultset as an array of objects.

Returns

object[]

getIterator()

getIterator()

Rewind()

Rewind()

Move the pointer to the first matching row in the recordset.

get_fileobject()

get_fileobject() : \SplFileObject

Get the file object used in this query.

Returns

\SplFileObject

wildcard()

wildcard(string $str)

A convenience method used to aide in converting a string that may (or may not) contain wildcard (*) characters into a string suitable for use in a substring match

Parameters

string $str

The string to parse for wildcards.

_query()

_query()

Use the data from the query object, perform the database query and set the recordset member.

This method should first see if the recordset has been set and not repeat the query... for the same of optimal behavior.