Structures_DataGrid_DataSource_Array
[ class tree: Structures_DataGrid_DataSource_Array ] [ index: Structures_DataGrid_DataSource_Array ] [ all elements ]

Class: Structures_DataGrid_DataSource_Array

Source Location: /Structures_DataGrid_DataSource_Array-0.2.0dev1/Structures/DataGrid/DataSource/Array.php

Class Overview

Structures_DataGrid_DataSource
   |
   --Structures_DataGrid_DataSource_Array

Array Data Source Driver


Author(s):

Version:

  • $Revision: 260158 $

Methods


Inherited Variables

Inherited Methods


Class Details

[line 84]
Array Data Source Driver

This class is a data source driver for a 2D array

SUPPORTED OPTIONS:

  • natsort: (boolean) Whether the array should be sorted naturally (e.g. example1, Example2, test1, Test2) or not (e.g. Example2, Test2, example1, test1; i.e. capital letters will come first).
GENERAL NOTES:

This driver expects an array of the following form:

  1.  $data = array(0 => array('col0' => 'val00''col1' => 'val01'...),
  2.                1 => array('col0' => 'val10''col1' => 'val11'...),
  3.                ...
  4.               );

The first level of this array contains one entry for each row. For every row entry an array with the data for this row is expected. Such an array contains the field names as the keys. For example, 'val01' is the value of the column with the field name 'col1' in the first row. Row numbers start with 0, not with 1.



[ Top ]


Method Detail

Structures_DataGrid_DataSource_Array (Constructor)   [line 95]

Structures_DataGrid_DataSource_Array Structures_DataGrid_DataSource_Array( )


[ Top ]

bind   [line 109]

mixed bind( array $ar, [ $options = array()])

Bind
  • Return: True on success, PEAR_Error on failure
  • Access: public

Parameters:

array   $ar   —  The result object to bind
   $options   — 

[ Top ]

count   [line 136]

int count( )

Count
  • Return: The number or records
  • Access: public

[ Top ]

fetch   [line 149]

array &fetch( [integer $offset = 0], [integer $len = null])

Fetch
  • Return: Array of records
  • Access: public

Parameters:

integer   $offset   —  Limit offset (starting from 0)
integer   $len   —  Limit length

[ Top ]

sort   [line 202]

void sort( string $sortSpec, [string $sortDir = null])

Sorts the array.
  • Access: public

Parameters:

string   $sortSpec   —  Field to sort by, or array of the form: array(field => direction, ...)
string   $sortDir   —  Sort direction: 'ASC' or 'DESC' (default: ASC)

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:40:02 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.