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.

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


	
			
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 25)

data array

  • access: protected
Methods
append (line 132)

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 167)

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 89)

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 118)

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 43)

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 229)

returns a variable if it was assigned

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

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 188)

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

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

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 60)

overwrites the entire data with the given array

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

unassigns/removes a variable

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

allows to read variables using the object syntax

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

supports calls to isset($dwooData->var)

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

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 218)

supports unsetting variables using the object syntax

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

Documentation generated on Sat, 18 Jul 2009 21:04:49 +0200 by phpDocumentor 1.4.0