File Manager

Current Path : /webspace/www.beetasty.be/html/wp-content/plugins/ameliabooking/src/Domain/ValueObjects/
Upload File :
Current File : //webspace/www.beetasty.be/html/wp-content/plugins/ameliabooking/src/Domain/ValueObjects/Gender.php

<?php

namespace AmeliaBooking\Domain\ValueObjects;

use AmeliaBooking\Domain\Common\Exceptions\InvalidArgumentException;

/**
 * Class Gender
 *
 * @package AmeliaBooking\Domain\ValueObjects
 */
final class Gender
{
    const GENDER_MALE = 'male';
    const GENDER_FEMALE = 'female';

    /**
     * @var string
     */
    private $value;

    /**
     * @param string $value
     *
     * @throws InvalidArgumentException
     */
    public function __construct($value)
    {
        if (!in_array($value, [self::GENDER_MALE, self::GENDER_FEMALE, null], true)) {
            throw new InvalidArgumentException('Not valid gender option');
        }
        $this->value = $value;
    }

    /**
     * Return the value from the value object
     *
     * @return string
     */
    public function getValue()
    {
        return $this->value;
    }
}

File Manager Version 1.0, Coded By Lucas
Email: hehe@yahoo.com