aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/DataFieldEmailEntry.class.php
blob: aafe7bbd3720b89e2a0df541df2bc98db6b5783d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
# Lifter002: DONE
# Lifter007: TEST

/**
 * @author  Jan-Hendrik Willms <tleilax+studip@gmail.com>
 * @author  Marcus Lunzenauer <mlunzena@uos.de>
 * @author  Martin Gieseking  <mgieseki@uos.de>
 * @license GPL2 or any later version
 */
class DataFieldEmailEntry extends DataFieldEntry
{
    protected $template = 'email.php';

    /**
     * Returns whether the datafield contents are valid
     *
     * @return boolean indicating whether the datafield contents are valid
     */
    public function isValid()
    {
        return parent::isValid()
            && (!$this->getValue() || filter_var($this->getValue(), FILTER_VALIDATE_EMAIL));
    }
}