public static function isSelected($value, $valueObject)
    {
        if(is_array($value) && count($value) > 0)
        {
            return in_array($valueObject, $value);
        }

        if($value instanceof Collection)
        {
            foreach($value as $v)
            {
                if($v->getKey() === $valueObject)
                {
                    return true;
                }
            }
            return false;
        }
        elseif($value === $valueObject)
        {
            return true;
        }
        return false;
    }
public static function isSelected($value, $valueObject)
    {
        if(is_array($value) && count($value) > 0)
        {
            return in_array($valueObject, $value);
        }

        if($value instanceof Collection)
        {
            foreach($value as $v)
            {
                if($v->getKey() === $valueObject)
                {
                    return true;
                }
            }
            return false;
        }
        elseif($value === $valueObject)
        {
            return true;
        }
        return false;
    }
public static function isSelected ( $ value , $ valueObject ) { if ( is_array ( $ value ) && count ( $ value ) > 0 ) { return in_array ( $ valueObject , $ value ) ; } if ( $ value instanceof Collection ) { foreach ( $ value as $ v ) { if ( $ v -> getKey ( ) === $ valueObject ) { return true ; } } return false ; } elseif ( $ value === $ valueObject ) { return true ; } return false ; }
Funtion to check if option from select is seleted

@access  public
@param   mixed   $value
@param   mixed   $valueObject
@return  boolean
Funtion to check if option from select is seleted