Class Dwoo_Data

Description

Implements interfaces:

dwoo data object, use it for complex data assignments or if you want to easily pass it around multiple functions to avoid passing an array by reference

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

This file is released under the LGPL "GNU Lesser General Public License" More information can be found here: http://www.gnu.org/copyleft/lesser.html

Located in /Dwoo/Data.php (line 23)


	
			
Variable Summary
array $data
Method Summary
void append (array|string $name, [mixed $val = null], [bool $merge = false])
void appendByRef (string $name,  &$val, [bool $merge = false], mixed $val)
void assign (array|string $name, [mixed $val = null])
void assignByRef (string $name,  &$val, mixed $val)
void clear ([array|string $name = null])
mixed get (string $name)
array getData ()
bool isAssigned (string $name)
void mergeData ( $data, array $data2)
void setData ( $data)
void unassign (string $name)
mixed __get (string $name)
void __isset (string $name)
void __set (string $name, string $value)
void __unset (string $name)
Variables
array $data = array() (line 30)

data array

  • access: protected
Methods
append (line 137)

appends values or an array of values to the data object

  • access: public
void append (array|string $name, [mixed $val = null], [bool $merge = false])
  • array|string $name: an associative array of multiple (index=>value) or a string that is the index to use, i.e. a value assigned to "foo" will be accessible in the template through {$foo}
  • mixed $val: the value to assign, or null if $name was an array
  • bool $merge: true to merge data or false to append, defaults to false
appendByRef (line 172)

appends a value by reference to the data object

  • access: public
void appendByRef (string $name,  &$val, [bool $merge = false], mixed $val)
  • string $name: the index to use, i.e. a value assigned to "foo" will be accessible in the template through {$foo}
  • mixed $val: the value to append by reference
  • bool $merge: true to merge data or false to append, defaults to false
  • &$val
assign (line 94)

assigns a value or an array of values to the data object

  • access: public
void assign (array|string $name, [mixed $val = null])
  • array|string $name: an associative array of multiple (index=>value) or a string that is the index to use, i.e. a value assigned to "foo" will be accessible in the template through {$foo}
  • mixed $val: the value to assign, or null if $name was an array
assignByRef (line 123)

assigns a value by reference to the data object

  • access: public
void assignByRef (string $name,  &$val, mixed $val)
  • string $name: the index to use, i.e. a value assigned to "foo" will be accessible in the template through {$foo}
  • mixed $val: the value to assign by reference
  • &$val
clear (line 48)

clears a the entire data or only the given key

  • access: public
void clear ([array|string $name = null])
  • array|string $name: clears only one value if you give a name, multiple values if you give an array of names, or the entire data if left null
get (line 234)

returns a variable if it was assigned

  • access: public
mixed get (string $name)
  • string $name: the variable name
getData (line 37)

returns the data array

  • access: public
array getData ()

Implementation of:
Dwoo_IDataProvider::getData()
returns the data as an associative array that will be used in the template
isAssigned (line 193)

returns true if the variable has been assigned already, false otherwise

  • access: public
bool isAssigned (string $name)
  • string $name: the variable name
mergeData (line 76)

merges the given array(s) with the current data with array_merge

  • access: public
void mergeData ( $data, array $data2)
  • array $data: the array to merge
  • array $data2: $data3 ... other arrays to merge, optional, etc.
setData (line 65)

overwrites the entire data with the given array

  • access: public
void setData ( $data)
  • array $data: the new data array to use
unassign (line 213)

unassigns/removes a variable

  • access: public
void unassign (string $name)
  • string $name: the variable name
__get (line 245)

allows to read variables using the object syntax

  • access: public
mixed __get (string $name)
  • string $name: the variable name
__isset (line 203)

supports calls to isset($dwooData->var)

  • access: public
void __isset (string $name)
  • string $name: the variable name
__set (line 111)

allows to assign variables using the object syntax

  • access: public
void __set (string $name, string $value)
  • string $name: the variable name
  • string $value: the value to assign to it
__unset (line 223)

supports unsetting variables using the object syntax

  • access: public
void __unset (string $name)
  • string $name: the variable name

Documentation generated on Sun, 03 Aug 2008 15:12:27 +0200 by phpDocumentor 1.4.0