1
0
Fork 0
mirror of synced 2025-04-03 13:23:37 +03:00

add iterator to tree walker chain

This commit is contained in:
shustrik 2014-02-06 19:39:40 +03:00
parent 6fe40b055f
commit 12985b7811
2 changed files with 176 additions and 117 deletions

View file

@ -29,19 +29,12 @@ namespace Doctrine\ORM\Query;
*/ */
class TreeWalkerChain implements TreeWalker class TreeWalkerChain implements TreeWalker
{ {
/**
* The tree walkers.
*
* @var string[]
*/
private $_walkersClasses = array();
/** /**
* The tree walkers. * The tree walkers.
* *
* @var TreeWalker[] * @var TreeWalker[]
*/ */
private $_walkers = array(); private $_walkers;
/** /**
* The original Query. * The original Query.
@ -96,6 +89,7 @@ class TreeWalkerChain implements TreeWalker
$this->_query = $query; $this->_query = $query;
$this->_parserResult = $parserResult; $this->_parserResult = $parserResult;
$this->_queryComponents = $queryComponents; $this->_queryComponents = $queryComponents;
$this->_walkers = new TreeWalkerChainIterator($this, $query, $parserResult);
} }
/** /**
@ -107,7 +101,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function addTreeWalker($walkerClass) public function addTreeWalker($walkerClass)
{ {
$this->_walkersClasses[] = $walkerClass; $this->_walkers[] = $walkerClass;
} }
/** /**
@ -115,8 +109,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkSelectStatement(AST\SelectStatement $AST) public function walkSelectStatement(AST\SelectStatement $AST)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkSelectStatement($AST); $walker->walkSelectStatement($AST);
$this->_queryComponents = $walker->getQueryComponents(); $this->_queryComponents = $walker->getQueryComponents();
@ -128,8 +121,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkSelectClause($selectClause) public function walkSelectClause($selectClause)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkSelectClause($selectClause); $walker->walkSelectClause($selectClause);
} }
} }
@ -139,8 +131,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkFromClause($fromClause) public function walkFromClause($fromClause)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkFromClause($fromClause); $walker->walkFromClause($fromClause);
} }
} }
@ -150,8 +141,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkFunction($function) public function walkFunction($function)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkFunction($function); $walker->walkFunction($function);
} }
} }
@ -161,8 +151,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkOrderByClause($orderByClause) public function walkOrderByClause($orderByClause)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkOrderByClause($orderByClause); $walker->walkOrderByClause($orderByClause);
} }
} }
@ -172,8 +161,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkOrderByItem($orderByItem) public function walkOrderByItem($orderByItem)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkOrderByItem($orderByItem); $walker->walkOrderByItem($orderByItem);
} }
} }
@ -183,8 +171,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkHavingClause($havingClause) public function walkHavingClause($havingClause)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkHavingClause($havingClause); $walker->walkHavingClause($havingClause);
} }
} }
@ -194,8 +181,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkJoin($join) public function walkJoin($join)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkJoin($join); $walker->walkJoin($join);
} }
} }
@ -205,8 +191,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkSelectExpression($selectExpression) public function walkSelectExpression($selectExpression)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkSelectExpression($selectExpression); $walker->walkSelectExpression($selectExpression);
} }
} }
@ -216,8 +201,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkQuantifiedExpression($qExpr) public function walkQuantifiedExpression($qExpr)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkQuantifiedExpression($qExpr); $walker->walkQuantifiedExpression($qExpr);
} }
} }
@ -227,8 +211,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkSubselect($subselect) public function walkSubselect($subselect)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkSubselect($subselect); $walker->walkSubselect($subselect);
} }
} }
@ -238,8 +221,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkSubselectFromClause($subselectFromClause) public function walkSubselectFromClause($subselectFromClause)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkSubselectFromClause($subselectFromClause); $walker->walkSubselectFromClause($subselectFromClause);
} }
} }
@ -249,8 +231,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkSimpleSelectClause($simpleSelectClause) public function walkSimpleSelectClause($simpleSelectClause)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkSimpleSelectClause($simpleSelectClause); $walker->walkSimpleSelectClause($simpleSelectClause);
} }
} }
@ -260,8 +241,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkSimpleSelectExpression($simpleSelectExpression) public function walkSimpleSelectExpression($simpleSelectExpression)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkSimpleSelectExpression($simpleSelectExpression); $walker->walkSimpleSelectExpression($simpleSelectExpression);
} }
} }
@ -271,8 +251,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkAggregateExpression($aggExpression) public function walkAggregateExpression($aggExpression)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkAggregateExpression($aggExpression); $walker->walkAggregateExpression($aggExpression);
} }
} }
@ -282,8 +261,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkGroupByClause($groupByClause) public function walkGroupByClause($groupByClause)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkGroupByClause($groupByClause); $walker->walkGroupByClause($groupByClause);
} }
} }
@ -293,8 +271,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkGroupByItem($groupByItem) public function walkGroupByItem($groupByItem)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkGroupByItem($groupByItem); $walker->walkGroupByItem($groupByItem);
} }
} }
@ -304,8 +281,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkUpdateStatement(AST\UpdateStatement $AST) public function walkUpdateStatement(AST\UpdateStatement $AST)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkUpdateStatement($AST); $walker->walkUpdateStatement($AST);
} }
} }
@ -315,8 +291,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkDeleteStatement(AST\DeleteStatement $AST) public function walkDeleteStatement(AST\DeleteStatement $AST)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkDeleteStatement($AST); $walker->walkDeleteStatement($AST);
} }
} }
@ -326,8 +301,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkDeleteClause(AST\DeleteClause $deleteClause) public function walkDeleteClause(AST\DeleteClause $deleteClause)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkDeleteClause($deleteClause); $walker->walkDeleteClause($deleteClause);
} }
} }
@ -337,8 +311,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkUpdateClause($updateClause) public function walkUpdateClause($updateClause)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkUpdateClause($updateClause); $walker->walkUpdateClause($updateClause);
} }
} }
@ -348,8 +321,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkUpdateItem($updateItem) public function walkUpdateItem($updateItem)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkUpdateItem($updateItem); $walker->walkUpdateItem($updateItem);
} }
} }
@ -359,8 +331,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkWhereClause($whereClause) public function walkWhereClause($whereClause)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkWhereClause($whereClause); $walker->walkWhereClause($whereClause);
} }
} }
@ -370,8 +341,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkConditionalExpression($condExpr) public function walkConditionalExpression($condExpr)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkConditionalExpression($condExpr); $walker->walkConditionalExpression($condExpr);
} }
} }
@ -381,8 +351,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkConditionalTerm($condTerm) public function walkConditionalTerm($condTerm)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkConditionalTerm($condTerm); $walker->walkConditionalTerm($condTerm);
} }
} }
@ -392,8 +361,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkConditionalFactor($factor) public function walkConditionalFactor($factor)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkConditionalFactor($factor); $walker->walkConditionalFactor($factor);
} }
} }
@ -403,8 +371,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkConditionalPrimary($condPrimary) public function walkConditionalPrimary($condPrimary)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkConditionalPrimary($condPrimary); $walker->walkConditionalPrimary($condPrimary);
} }
} }
@ -414,8 +381,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkExistsExpression($existsExpr) public function walkExistsExpression($existsExpr)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkExistsExpression($existsExpr); $walker->walkExistsExpression($existsExpr);
} }
} }
@ -425,8 +391,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkCollectionMemberExpression($collMemberExpr) public function walkCollectionMemberExpression($collMemberExpr)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkCollectionMemberExpression($collMemberExpr); $walker->walkCollectionMemberExpression($collMemberExpr);
} }
} }
@ -436,8 +401,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkEmptyCollectionComparisonExpression($emptyCollCompExpr) public function walkEmptyCollectionComparisonExpression($emptyCollCompExpr)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkEmptyCollectionComparisonExpression($emptyCollCompExpr); $walker->walkEmptyCollectionComparisonExpression($emptyCollCompExpr);
} }
} }
@ -447,8 +411,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkNullComparisonExpression($nullCompExpr) public function walkNullComparisonExpression($nullCompExpr)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkNullComparisonExpression($nullCompExpr); $walker->walkNullComparisonExpression($nullCompExpr);
} }
} }
@ -458,8 +421,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkInExpression($inExpr) public function walkInExpression($inExpr)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkInExpression($inExpr); $walker->walkInExpression($inExpr);
} }
} }
@ -469,8 +431,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
function walkInstanceOfExpression($instanceOfExpr) function walkInstanceOfExpression($instanceOfExpr)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkInstanceOfExpression($instanceOfExpr); $walker->walkInstanceOfExpression($instanceOfExpr);
} }
} }
@ -480,8 +441,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkLiteral($literal) public function walkLiteral($literal)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkLiteral($literal); $walker->walkLiteral($literal);
} }
} }
@ -491,8 +451,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkBetweenExpression($betweenExpr) public function walkBetweenExpression($betweenExpr)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkBetweenExpression($betweenExpr); $walker->walkBetweenExpression($betweenExpr);
} }
} }
@ -502,8 +461,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkLikeExpression($likeExpr) public function walkLikeExpression($likeExpr)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkLikeExpression($likeExpr); $walker->walkLikeExpression($likeExpr);
} }
} }
@ -513,8 +471,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkStateFieldPathExpression($stateFieldPathExpression) public function walkStateFieldPathExpression($stateFieldPathExpression)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkStateFieldPathExpression($stateFieldPathExpression); $walker->walkStateFieldPathExpression($stateFieldPathExpression);
} }
} }
@ -524,8 +481,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkComparisonExpression($compExpr) public function walkComparisonExpression($compExpr)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkComparisonExpression($compExpr); $walker->walkComparisonExpression($compExpr);
} }
} }
@ -535,8 +491,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkInputParameter($inputParam) public function walkInputParameter($inputParam)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkInputParameter($inputParam); $walker->walkInputParameter($inputParam);
} }
} }
@ -546,8 +501,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkArithmeticExpression($arithmeticExpr) public function walkArithmeticExpression($arithmeticExpr)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkArithmeticExpression($arithmeticExpr); $walker->walkArithmeticExpression($arithmeticExpr);
} }
} }
@ -557,9 +511,8 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkArithmeticTerm($term) public function walkArithmeticTerm($term)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass); $walker->walkArithmeticTerm($term);
$walkerClass->walkArithmeticTerm($term);
} }
} }
@ -568,8 +521,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkStringPrimary($stringPrimary) public function walkStringPrimary($stringPrimary)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkStringPrimary($stringPrimary); $walker->walkStringPrimary($stringPrimary);
} }
} }
@ -579,8 +531,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkArithmeticFactor($factor) public function walkArithmeticFactor($factor)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkArithmeticFactor($factor); $walker->walkArithmeticFactor($factor);
} }
} }
@ -590,8 +541,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkSimpleArithmeticExpression($simpleArithmeticExpr) public function walkSimpleArithmeticExpression($simpleArithmeticExpr)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkSimpleArithmeticExpression($simpleArithmeticExpr); $walker->walkSimpleArithmeticExpression($simpleArithmeticExpr);
} }
} }
@ -601,8 +551,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkPathExpression($pathExpr) public function walkPathExpression($pathExpr)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkPathExpression($pathExpr); $walker->walkPathExpression($pathExpr);
} }
} }
@ -612,8 +561,7 @@ class TreeWalkerChain implements TreeWalker
*/ */
public function walkResultVariable($resultVariable) public function walkResultVariable($resultVariable)
{ {
foreach ($this->_walkersClasses as $walkerClass) { foreach ($this->_walkers as $walker) {
$walker = $this->getWalker($walkerClass);
$walker->walkResultVariable($resultVariable); $walker->walkResultVariable($resultVariable);
} }
} }
@ -624,19 +572,4 @@ class TreeWalkerChain implements TreeWalker
public function getExecutor($AST) public function getExecutor($AST)
{ {
} }
/**
* @param $walkerClass
*
* @return TreeWalker
*/
private function getWalker($walkerClass)
{
$key = array_search($walkerClass, $this->_walkersClasses);
if (!isset($this->_walkers[$key])) {
$this->_walkers[$key] = new $walkerClass($this->_query, $this->_parserResult, $this->_queryComponents);
}
return $this->_walkers[$key];
}
} }

View file

@ -0,0 +1,126 @@
<?php
/**
* doctrine2
* User: shustrik
* Date: 2/6/14
* Time: 7:03 PM
*/
namespace Doctrine\ORM\Query;
class TreeWalkerChainIterator implements \Iterator, \ArrayAccess
{
/**
* @var TreeWalker[]
*/
private $walkers = array();
/**
* @var TreeWalkerChain
*/
private $treeWalkerChain;
/**
* @var
*/
private $query;
/**
* @var
*/
private $parserResult;
public function __construct(TreeWalkerChain $treeWalkerChain, $query, $parserResult)
{
$this->treeWalkerChain = $treeWalkerChain;
$this->query = $query;
$this->parserResult = $parserResult;
}
/**
* {@inheritdoc}
*/
function rewind()
{
return reset($this->walkers);
}
/**
* {@inheritdoc}
*/
function current()
{
return $this->offsetGet(key($this->walkers));
}
/**
* {@inheritdoc}
*/
function key()
{
return key($this->walkers);
}
/**
* {@inheritdoc}
*/
function next()
{
next($this->walkers);
return $this->offsetGet(key($this->walkers));
}
/**
* {@inheritdoc}
*/
function valid()
{
return key($this->walkers) !== null;
}
/**
* {@inheritdoc}
*/
public function offsetExists($offset)
{
return isset($this->walkers[$offset]);
}
/**
* {@inheritdoc}
*/
public function offsetGet($offset)
{
if ($this->offsetExists($offset)) {
return new $this->walkers[$offset](
$this->query,
$this->parserResult,
$this->treeWalkerChain->getQueryComponents()
);
}
return null;
}
/**
* {@inheritdoc}
*/
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->walkers[] = $value;
} else {
$this->walkers[$offset] = $value;
}
}
/**
* {@inheritdoc}
*/
public function offsetUnset($offset)
{
if ($this->offsetExists($offset)) {
unset($this->walkers[$offset]);
}
}
}