Zend Framework  1.12
Public Member Functions | Protected Attributes | List of all members
Zend_Tool_Project_Profile_Resource_Container Class Reference

Public Member Functions

 search ($matchSearchConstraints, $nonMatchSearchConstraints=null)
 Finder method to be able to find resources by context name and attributes.
 
 createResourceAt ($appendResourceOrSearchConstraints, $context, Array $attributes=array())
 createResourceAt()
 
 createResource ($context, Array $attributes=array())
 createResource()
 
 setAttributes (Array $attributes)
 setAttributes()
 
 getAttributes ()
 getAttributes()
 
 setAttribute ($name, $value)
 setAttribute()
 
 getAttribute ($name)
 getAttribute()
 
 hasAttribute ($name)
 hasAttribute()
 
 setAppendable ($appendable)
 setAppendable()
 
 isAppendable ()
 isAppendable()
 
 setParentResource (Zend_Tool_Project_Profile_Resource_Container $parentResource)
 setParentResource()
 
 getParentResource ()
 getParentResource()
 
 append (Zend_Tool_Project_Profile_Resource_Container $resource)
 append()
 
 current ()
 current() - required by RecursiveIterator
 
 key ()
 key() - required by RecursiveIterator
 
 next ()
 next() - required by RecursiveIterator
 
 rewind ()
 rewind() - required by RecursiveIterator
 
 valid ()
 valid() - - required by RecursiveIterator
 
 hasChildren ()
 hasChildren()
 
 getChildren ()
 getChildren()
 
 count ()
 count()
 
 __clone ()
 __clone()
 

Protected Attributes

 $_subResources = array()
 
 $_position = 0
 
 $_appendable = true
 
 $_attributes = array()
 

Member Function Documentation

__clone ( )
count ( )

count()

Returns
int
createResource (   $context,
Array  $attributes = array() 
)

createResource()

Method to create a resource with a given context with specific attributes

Parameters
string$context
array$attributes
Returns
Zend_Tool_Project_Profile_Resource

Interesting logic here:

First set the parentResource (this will also be done inside append). This will allow the initialization routine to change the appendability of the parent resource. This is important to allow specific resources to be appendable by very specific sub-resources.

createResourceAt (   $appendResourceOrSearchConstraints,
  $context,
Array  $attributes = array() 
)

createResourceAt()

Parameters
array | Zend_Tool_Project_Profile_Resource_SearchConstraints$appendResourceOrSearchConstraints
string$context
array$attributes
Returns
Zend_Tool_Project_Profile_Resource
current ( )

current() - required by RecursiveIterator

Returns
Zend_Tool_Project_Profile_Resource
getAttribute (   $name)
getAttributes ( )

getAttributes()

Returns
array
getChildren ( )

getChildren()

Returns
array
getParentResource ( )
hasAttribute (   $name)

hasAttribute()

Parameters
string$name
Returns
bool
hasChildren ( )

hasChildren()

Returns
bool
isAppendable ( )

isAppendable()

Returns
bool
key ( )

key() - required by RecursiveIterator

Returns
int
next ( )

next() - required by RecursiveIterator

Returns
bool
rewind ( )

rewind() - required by RecursiveIterator

Returns
bool
search (   $matchSearchConstraints,
  $nonMatchSearchConstraints = null 
)

Finder method to be able to find resources by context name and attributes.

Example usage:

Parameters
Zend_Tool_Project_Profile_Resource_SearchConstraints | string | array$searchParameters
Returns
Zend_Tool_Project_Profile_Resource
Todo:
This should be re-written with better support for a filter iterator, its the way to go
setAppendable (   $appendable)
setAttribute (   $name,
  $value 
)

setAttribute()

Parameters
string$name
mixed$value
Returns
Zend_Tool_Project_Profile_Resource_Container
setAttributes ( Array  $attributes)

setAttributes()

persist the attributes if the resource will accept them

Parameters
array$attributes
Returns
Zend_Tool_Project_Profile_Resource_Container
setParentResource ( Zend_Tool_Project_Profile_Resource_Container  $parentResource)
valid ( )

valid() - - required by RecursiveIterator

Returns
bool

Member Data Documentation

$_appendable = true
protected
$_attributes = array()
protected
$_position = 0
protected
$_subResources = array()
protected