Development

/plugins/swToolboxPlugin/sf1.2/trunk/lib/validators/swValidatorGMapAddress.class.php

You must first sign up to be able to contribute.

root/plugins/swToolboxPlugin/sf1.2/trunk/lib/validators/swValidatorGMapAddress.class.php

Revision 15932, 1.8 kB (checked in by rande, 2 years ago)

add swWidgetFormGMapAddress

Line 
1 <?php
2 /*
3  *  $Id$
4  *
5  * (c) 2009 Thomas Rabaix <thomas.rabaix@soleoweb.com>
6  *
7  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
9  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
10  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
11  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
12  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
13  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
14  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
15  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
16  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
17  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
18  *
19  * This software consists of voluntary contributions made by many individuals
20  * and is licensed under the LGPL. For more information, see
21  * <http://www.soleoweb.com>.
22  */
23
24 /**
25  * swGMapSimpleValidator validate the address field
26  *
27  * @package    swToolboxPlugin
28  * @subpackage widget
29  * @author    Thomas Rabaix <thomas.rabaix@soleoweb.com>
30  * @version    SVN: $Id$
31  */
32 class swValidatorGMapAddress extends sfValidatorSchema
33 {
34   public function __construct($fields = null, $options = array(), $messages = array())
35   {
36     $fields = array(
37       'lat'     => new sfValidatorNumber(array(
38         'min' => -90
39         'max' => 90,
40         'required' => true
41       )),
42       'lng'     => new sfValidatorNumber(array(
43         'min' => -180,
44         'max' => 180,
45         'required' => true
46       )),
47       'address' => new swValidatorText(array(
48         'required' => true
49       )),
50     );
51     
52     parent::__construct($fields, $options, $messages);
53   }
54 }
Note: See TracBrowser for help on using the browser.

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.