root/trunk/patForms/AttributeFilter.php

Revision 349, 1.6 kB (checked in by gerd, 3 years ago)

Draft of new feature: attribute filter

  • Property svn:keywords set to "Id"
Line 
1 <?php
2 /**
3  * patForms attribute filter base class - extend this to create your own filters.
4  *
5  * $Id$
6  *
7  * @package        patForms
8  * @subpackage    AttriibuteFilter
9  */
10
11 /**
12  * patForms filter base class - extend this to create your own filters.
13  *
14  * @package     patForms
15  * @subpackage  attibuteFilter
16  * @author      gERD Schaufelberger <gerd@php-toole.net>
17  * @license     LGPL, see license.txt for details
18  * @lik         http://www.php-tools.net
19  */
20 class patForms_AttributeFilter
21 {
22    /**
23     * Filter attribute value on "apply"-event
24     *
25     * This method is applied when patForms_Element:applyAttributeFilter()
26     * or patForms::applyAttributeFilter() is called.
27     *
28     * @abstract
29     * @access   public
30     * @param    string  element's type
31     * @param    string  attribute's names
32     * @param    mixed   attribute's value
33     * @return   mixed   true on success, patError-object on error
34     */
35     function onApply($type, $attribute, &$value)
36     {
37         return true;
38     }
39
40    /**
41     * Filter attribute value on "set"-event
42     *
43     * This method is invoced whenever patForms_Element::setAttribute() is called.
44     * The exception is during the initializing process, when the form is created.
45     * When the element is new, there is no attribute filter available.
46     *
47     * @abstract
48     * @access    public
49     * @param    string    element's type
50     * @param    string  attribute's names
51     * @param    mixed   attribute's value
52     * @return   mixed   true on success, patError-object on error
53     */
54     function onSet($type, $attribute, &$value)
55     {
56         return true;
57     }
58 }
59 ?>
Note: See TracBrowser for help on using the browser.