Permalink
Browse files

+ cleaned up filter map

  • Loading branch information...
1 parent ae99fbc commit 4fde5bab6205e01a94d1c8adc9d52127ac176bbd @jgswift jgswift committed Mar 22, 2011
@@ -82,7 +82,7 @@ function __invoke( &$dataSource = null )
function Fill( &$dataSource )
{
- $this->execute( $dataSource, self::SELECT );
+ return $this->execute( $dataSource, self::SELECT );
}
function Insert( &$dataSource )
@@ -1,17 +0,0 @@
-<?php
-namespace DBAL\Data\Entity\Relationship;
-
-abstract class Loader extends \DBAL\Data\Loader
-{
-
-
- function __construct( \Core\Object $object )
- {
- $this->setSource( $object );
- }
-
- function load( $path, $args = null)
- {
-
- }
-}
@@ -43,10 +43,10 @@ protected function execute( array $params = array() )
$input = $params['input'];
$state = $params['state'];
- if( !$this->hasMap( $state ) )
+ if( !$this->hasMap() )
return $input;
- $filters = $this->Map->getFilters( $state );
+ $filters = $this->Map->getFilters();
foreach( $filters as $filter )
{
View
@@ -2,15 +2,12 @@
namespace IO\Filter;
class Map extends \Util\Collection\Iterator
-{
- private $_states = array();
-
+{
function register( \IO\Filter $filter )
{
$c = count( $this->Keys );
$this->Keys[$c] = $filter->getName();
$this->Data[$c] = $filter;
- $this->_states[$c] = $filter->getState();
}
function recurse( \IO\Filter $filter, array $params = array() )
@@ -32,42 +29,14 @@ function __invoke( $params = null )
return $this->execute( $params );
}
- function hasFilterState( $state )
+ function hasFilter( $class )
{
- return in_array( $state, $this->_states );
- }
-
- function hasFilter( $class, $state = null )
- {
- if( is_int( $state ))
- {
- $val = $this->offsetGet( $class );
- if( array_key_exists( $val, $this->_states ) &&
- $this->_states[$val] == $state )
- return true;
-
- return false;
- }
return $this->offsetExists( $class );
}
- function getFilters( $state = null )
+ function getFilters()
{
- if( is_int( $state ))
- {
- $keys = array_keys( $this->_states, $state );
- if( is_array( $keys ))
- {
- $result = array();
- foreach( $keys as $key )
- $result[] = $this->Data[$key];
-
- return $result;
- }
- else
- return null;
- }
- return $this->getArray();
+ return $this->Data;
}
function setFilters( array $filters )
@@ -25,7 +25,10 @@ function getDefaultBuilder()
function setBuilder( \Kinesis\Task\Builder $builder )
{
- if( !array_key_exists('Namespace', $this->Parameters ))
+ if( array_key_exists( 'Namespace', $builder->Parameters ))
+ $this->Parameters['Namespace'] = $builder->Parameters['Namespace'];
+
+ if( !array_key_exists('Namespace', $this->Parameters ) )
$this->Parameters['Namespace'] = get_class( $builder );
$builder->setComponent( $this );

0 comments on commit 4fde5ba

Please sign in to comment.