public function setFlags(array $flags)
    {
        // Check types of flags
        $types = array_filter($flags, 'is_array');
        if (count($types) !== count($flags)) {
            throw new InvalidArgumentException('Flags must be passed as an array');
        }

        $this->options['flags'] = $flags;
    }