1 <?php
2
3 /* --------------------------------------------------------------
4 EmailStringType.inc.php 2015-12-14
5 Gambio GmbH
6 http://www.gambio.de
7 Copyright (c) 2015 Gambio GmbH
8 Released under the GNU General Public License (Version 2)
9 [http://www.gnu.org/licenses/gpl-2.0.html]
10 --------------------------------------------------------------
11 */
12
13 /**
14 * Class EmailStringType
15 *
16 * Shared email string type class. Use the "asString" method for getting the plain value.
17 *
18 * @category System
19 * @package Shared
20 * @subpackage Types
21 */
22 class EmailStringType extends NonEmptyStringType
23 {
24 /**
25 * Class Constructor
26 *
27 * @param string $p_email
28 */
29 public function __construct($p_email)
30 {
31 parent::__construct($p_email);
32
33 if(!filter_var($p_email, FILTER_VALIDATE_EMAIL))
34 {
35 throw new UnexpectedValueException('$p_email is not a valid e-mail address');
36 }
37 }
38 }