public function setType($type = null)
    {
        if (! is_null($type) && ! $this->isValidType($type)) {
            throw new InvalidArgumentException("Given batch modification type is invalid.");
        }

        $this->type = $type;

        return $this;
    }