<?php

/**
 * A definition for a simple class that accepts a value between 0 and 1
 *
 * @package CGContacts
 * @category Productivity
 * @author  calguy1000 <calguy1000@cmsmadesimple.org>
 * @copyright Copyright 2014 by Robert Campbell
 */

namespace CGContacts;

/**
 * A simple class to allow storing a daily wage (a number) with a contact.
 */
class contact_score01 extends \CGContacts\contact_single_value
{
    public function validate()
    {
        parent::validate();
        $val = (float) $this->get_value();
        if( $val < 0 || $val > 1 ) throw new \CmsInvalidDataException('The value for the score is invalid');
    }
}

?>
