<?php

namespace InforItem;

/**
 * This class stands for logicalOperator EnumType
 * @package Item_
 * @subpackage Enumerations
 */
class Item_LogicalOperator
{
    /**
     * Constant for value 'or'
     * @return string 'or'
     */
    const VALUE_OR = 'or';
    /**
     * Constant for value 'and'
     * @return string 'and'
     */
    const VALUE_AND = 'and';
    /**
     * Return true if value is allowed
     * @uses self::getValidValues()
     * @param mixed $value value
     * @return bool true|false
     */
    public static function valueIsValid($value)
    {
        return ($value === null) || in_array($value, self::getValidValues(), true);
    }
    /**
     * Return allowed values
     * @uses self::VALUE_OR
     * @uses self::VALUE_AND
     * @return string[]
     */
    public static function getValidValues()
    {
        return array(
            self::VALUE_OR,
            self::VALUE_AND,
        );
    }
    /**
     * Method returning the class name
     * @return string __CLASS__
     */
    public function __toString()
    {
        return __CLASS__;
    }
}
