mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merged revisions 47815 via svnmerge from
svn://svn.silverstripe.com/silverstripe/modules/sapphire/branches/2.2.0-mesq ........ r47815 | ischommer | 2008-01-10 14:54:27 +1300 (Thu, 10 Jan 2008) | 1 line documentation ........ git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@47812 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
f1fdd81bc3
commit
c22bb87647
@ -6,15 +6,15 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Lets you wrap a bunch of array data into a ViewableData object.
|
* Lets you wrap a bunch of array data into a {@link ViewableData} object.
|
||||||
* This is useful when you want to pass data to a template in the "SilverStripe 1" way of giving a
|
|
||||||
* big data array.
|
|
||||||
*
|
*
|
||||||
* Usage:
|
* <code>
|
||||||
* new ArrayData(array(
|
* new ArrayData(array(
|
||||||
* "ClassName" => "Page",
|
* "ClassName" => "Page",
|
||||||
* "AddAction" => "Add a new Page page",
|
* "AddAction" => "Add a new Page page",
|
||||||
* ));
|
* ));
|
||||||
|
* </code>
|
||||||
|
*
|
||||||
* @package sapphire
|
* @package sapphire
|
||||||
* @subpackage view
|
* @subpackage view
|
||||||
*/
|
*/
|
||||||
@ -23,7 +23,8 @@ class ArrayData extends ViewableData {
|
|||||||
protected $array;
|
protected $array;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param object|array $array Either an object with simple properties or an associative array
|
* @param object|array $array Either an object with simple properties or an associative array.
|
||||||
|
* Converts object-properties to indices of an associative array.
|
||||||
*/
|
*/
|
||||||
public function __construct($array) {
|
public function __construct($array) {
|
||||||
if(is_object($array)) {
|
if(is_object($array)) {
|
||||||
|
@ -6,7 +6,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class represents a set of database objects, such as the results of a query
|
* This class represents a set of {@link ViewableData} subclasses (mostly {@link DataObject} or {@link ArrayData}.
|
||||||
|
* It is used by the ORM-layer of Silverstripe to return query-results from {@link SQLQuery}.
|
||||||
* @package sapphire
|
* @package sapphire
|
||||||
* @subpackage model
|
* @subpackage model
|
||||||
*/
|
*/
|
||||||
@ -62,10 +63,10 @@ class DataObjectSet extends ViewableData implements Iterator {
|
|||||||
protected $paginationGetVar = "start";
|
protected $paginationGetVar = "start";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new DataObjectSet.
|
* Create a new DataObjectSet. If you pass one or more arguments, it will try to convert them into {@link ArrayData} objects.
|
||||||
|
* TODO Does NOT automatically convert objects with complex datatypes (e.g. converting arrays within an objects to its own DataObjectSet)
|
||||||
*
|
*
|
||||||
* @param ViewableData|array|mixed $items Parameters to use in this set, either as an associative array, object with simple properties, or as multiple parameters.
|
* @param ViewableData|array|mixed $items Parameters to use in this set, either as an associative array, object with simple properties, or as multiple parameters.
|
||||||
* TODO Does NOT automatically convert objects with complex datatypes (e.g. converting arrays within an objects to its own DataObjectSet)
|
|
||||||
*/
|
*/
|
||||||
public function __construct($items = null) {
|
public function __construct($items = null) {
|
||||||
if($items) {
|
if($items) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user