[Solar-svn] Revision 2634
pmjones at solarphp.com
pmjones at solarphp.com
Thu Jul 26 20:18:42 CDT 2007
Branch: Solar_Filter_Chain: [CHG] Use a dependency injection instead of a filter-class name; updated comments.
Modified: branches/orm/Solar/Filter/Chain.php
===================================================================
--- branches/orm/Solar/Filter/Chain.php 2007-07-27 01:12:12 UTC (rev 2633)
+++ branches/orm/Solar/Filter/Chain.php 2007-07-27 01:18:42 UTC (rev 2634)
@@ -1,7 +1,8 @@
<?php
/**
*
- * Applies a chain (or stack) of filters to apply to an array of data.
+ * Applies a chain (or stack) of filters to an array of data: validates and
+ * sanitizes, and retains messages about invalid elements.
*
* @category Solar
*
@@ -17,7 +18,8 @@
/**
*
- * Applies a chain (or stack) of filters to apply to an array of data.
+ * Applies a chain (or stack) of filters to an array of data: validates and
+ * sanitizes, and retains messages about invalid elements.
*
* @category Solar
*
@@ -33,15 +35,15 @@
*
* Keys are ...
*
- * `filter_class`
- * : (string) The class name to use when constructing the filter object.
- * Default is 'Solar_Filter'.
+ * `filter`
+ * : (dependency) A Solar_Filter dependency object. Default is null,
+ * which creates a new Solar_Filter object.
*
* @var array
*
*/
protected $_Solar_Filter_Chain = array(
- 'filter_class' => 'Solar_Filter',
+ 'filter' => null,
);
/**
@@ -206,7 +208,7 @@
/**
*
- * Adds many filters for many data keys.
+ * Adds many filters for one data key.
*
* @param array $list An array of data keys and filter specifications.
*
@@ -283,10 +285,11 @@
// reset the list of invalid keys
$this->_invalid = array();
- // if we don't have a filter object, create one
+ // if we don't have a filter object already, get one as a dependency
if (! $this->_filter_object) {
- $this->_filter_object = Solar::factory(
- $this->_config['filter_class']
+ $this->_filter_object = Solar::dependency(
+ 'Solar_Filter',
+ $this->_config['filter']
);
}
More information about the Solar-svn
mailing list