<?php

namespace AC\Form\Element;

class MultiSelect extends Select
{

    public function __construct(string $name, array $options = [])
    {
        parent::__construct($name, $options);

        $this->set_attribute('multiple', 'multiple');
    }

    protected function selected($value): bool
    {
        return in_array($value, (array)$this->get_value(), true);
    }

}