Dotclear 2.24
Loading...
Searching...
No Matches
dcRecord Class Reference
Inheritance diagram for dcRecord:

Public Member Functions

 __construct ($record)
 
 toStatic ()
 
 toExtStatic ()
 
 __call (string $f, $args)
 
 __get ($n)
 
 f ($n)
 
 field ($n)
 
 exists ($n)
 
 __isset (string $n)
 
 extend (string $class)
 
 extensions ()
 
 index (?int $row=null)
 
 fetch ()
 
 moveStart ()
 
 moveEnd ()
 
 moveNext ()
 
 movePrev ()
 
 isEnd ()
 
 isStart ()
 
 isEmpty ()
 
 columns ()
 
 rows ()
 
 row ()
 
 count ()
 
 current ()
 
 key ()
 
 next ()
 
 rewind ()
 
 valid ()
 
 set ($n, $v)
 
 sort ($field, string $order='asc')
 
 lexicalSort (string $field, string $order='asc')
 

Static Public Member Functions

static newFromArray (?array $data)
 

Protected Attributes

 $dynamic
 
 $static
 

Constructor & Destructor Documentation

◆ __construct()

__construct (   $record)

Constructs a new instance.

Parameters
record | staticRecord | extStaticRecord$recordThe record

Member Function Documentation

◆ toStatic()

toStatic ( )

To staticRecord

Converts the dynamic record to a staticRecord instance.

Note: All dcRecord methods (unless staticRecord spécific, see at end of this file) will try first with the extStaticRecord|staticRecord instance, if exist.

Returns
self Static representation of the object.

Referenced by dcMeta\computeMetaStats().

◆ toExtStatic()

toExtStatic ( )

To extStaticRecord

Converts the static record to a extStaticRecord instance.

Notes:

  • The static record is created from the dynamic one if it does not exist
  • All dcRecord methods (unless (ext)staticRecord spécific, see at end of this file) will try first with the extStaticRecord|staticRecord instance, if exist.
Returns
self Static representation of the object.

Referenced by rsExtUser\toExtStatic(), and rsExtBlog\toExtStatic().

◆ __call()

__call ( string  $f,
  $args 
)

Magic call

Magic call function. Calls function added by extend() if exists, passing it self object and arguments.

Parameters
string$fFunction name
mixed$argsArguments
Returns
mixed

◆ __get()

__get (   $n)

Magic get

Alias for field().

Parameters
string | int$nField name or field position
Returns
mixed

References field().

◆ f()

f (   $n)

Get field

Alias for field().

Parameters
string | int$nField name or field position
Returns
mixed

References field().

◆ field()

field (   $n)

Get field value

Parameters
string | int$nField name|position
Returns
mixed

Referenced by __get(), and f().

◆ exists()

exists (   $n)

Check if a field exists

Parameters
string | int$nField name|position
Returns
bool

Referenced by rsExtPost\isDeletable(), rsExtPost\isEditable(), dcAntispam\statusMessage(), dcSpamFilters\statusMessage(), and dcAntispam\trainFilters().

◆ __isset()

__isset ( string  $n)

Field isset

Returns true if a field exists (magic method from PHP 5.1).

Parameters
string$nField name
Returns
bool

◆ extend()

extend ( string  $class)

Extend record

Extends this instance capabilities by adding all public static methods of $class to current instance. Class methods should take at least this record as first parameter.

See also
__call()
Parameters
string$classClass name

◆ extensions()

extensions ( )

Returns record extensions.

Returns
array

◆ index()

index ( ?int  $row = null)

Get current index

Parameters
int$rowThe row
Returns
mixed

Referenced by rsExtPost\countMedia(), and key().

◆ fetch()

fetch ( )

One step move index

This method moves index forward and return true until index is not the last one. You can use it to loop over record. Example: while ($rs->fetch()) { echo $rs->field1; }

Returns
bool

Referenced by dcAdminCombos\getCategoriesCombo(), dcAdminCombos\getDatesCombo(), dcAdminCombos\getLangsCombo(), dcAdminCombos\getUsersCombo(), and adminPost\showComments().

◆ moveStart()

moveStart ( )

Moves index to first position.

Returns
bool

◆ moveEnd()

moveEnd ( )

Moves index to last position.

Returns
bool

◆ moveNext()

moveNext ( )

Moves index to next position.

Returns
bool

Referenced by rsExtPost\firstPostOfDay(), rsExtPost\lastPostOfDay(), rsExtDates\yearFooter(), and rsExtDates\yearHeader().

◆ movePrev()

movePrev ( )

Moves index to previous position.

Returns
bool

Referenced by rsExtPost\firstPostOfDay(), rsExtPost\lastPostOfDay(), rsExtDates\yearFooter(), and rsExtDates\yearHeader().

◆ isEnd()

isEnd ( )

Check if index is at last position

Returns
bool

Referenced by rsExtPost\lastPostOfDay(), and rsExtDates\yearFooter().

◆ isStart()

isStart ( )

Check if index is at first position

Returns
bool

Referenced by rsExtPost\firstPostOfDay(), and rsExtDates\yearHeader().

◆ isEmpty()

isEmpty ( )

Check if record is empty (no result)

Returns
bool

Referenced by dcMedia\fileRecord().

◆ columns()

columns ( )

Get columns

Returns
array array of columns, with name as key and type as value.

◆ rows()

rows ( )

Get record rows

Returns
array

Referenced by dcBlogroll\getLinksHierarchy().

◆ row()

row ( )
Returns
array current rows.

◆ count()

count ( )
Returns
int number of rows in record

◆ current()

current ( )
See also
Iterator::current

◆ key()

key ( )
See also
Iterator::key

References index().

◆ next()

next ( )
See also
Iterator::next

◆ rewind()

rewind ( )
See also
Iterator::rewind

◆ valid()

valid ( )
See also
Iterator::valid

◆ newFromArray()

static newFromArray ( ?array  $data)
static

dcRecord from array

Returns a new instance of object from an associative array.

Parameters
array$dataData array
Returns
dcRecord

References staticRecord\newFromArray().

Referenced by dcBlog\getCategories(), adminMediaPage\getDirsRecord(), and dcMeta\getMetaRecordset().

◆ set()

set (   $n,
  $v 
)

Changes value of a given field in the current row.

Parameters
string | int$nField name|position
mixed$vField value
Returns
mixed

◆ sort()

sort (   $field,
string  $order = 'asc' 
)

Sorts values by a field in a given order.

Parameters
string | int$fieldField name|position
string$orderSort type (asc or desc)
Returns
mixed

◆ lexicalSort()

lexicalSort ( string  $field,
string  $order = 'asc' 
)

Lexically sorts values by a field in a given order.

Parameters
string$fieldThe field
string$orderThe order

Field Documentation

◆ $dynamic

$dynamic
protected

◆ $static

$static
protected

The documentation for this class was generated from the following file: