~katiekitty/+junk/solidstate

« back to all changes in this revision

Viewing changes to solidstate/branches/v0.5 Alpha/solidworks/validators/BooleanValidator.class.php

  • Committer: root
  • Date: 2010-01-13 07:44:31 UTC
  • Revision ID: root@ds3-vamp.cs-monitor.cz.cc-20100113074431-kt8ceoeznpjg22x7
Reviving the project

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/**
 
3
 * BooleanValidator.class.php
 
4
 *
 
5
 * This file contains the definition of the BooleanValidator class.  
 
6
 *
 
7
 * @package SolidWorks
 
8
 * @author John Diamond <jdiamond@solid-state.org>
 
9
 * @copyright John Diamond <jdiamond@solid-state.org>
 
10
 * @license http://www.opensource.org/licenses/gpl-license.php GNU Public License
 
11
 */
 
12
 
 
13
/**
 
14
 * BooleanValidator
 
15
 *
 
16
 * @package SolidWorks
 
17
 * @author John Diamond <jdiamond@solid-state.org>
 
18
 */
 
19
class BooleanValidator extends NumberValidator
 
20
{
 
21
  /**
 
22
   * Validate a Boolean Field
 
23
   *
 
24
   * @param string $data Field data
 
25
   * @return string This function may alter data before validating it, if so this is the result
 
26
   * @throws FieldException, FieldSizeException
 
27
   */
 
28
  public function validate( $data )
 
29
  {
 
30
    return (boolean) $data;
 
31
  }
 
32
}
 
33
?>
 
 
b'\\ No newline at end of file'