public function setGroup($group)
    {
        if (!is_string($group) && $group !== null) {
            throw new InvalidArgumentException(sprintf(
                'Attachment group must be string, received %s',
                is_object($group) ? get_class($group) : gettype($group)
            ));
        }

        $this->group = $group;

        return $this;
    }
public function setGroup($group)
    {
        if (!is_string($group) && $group !== null) {
            throw new InvalidArgumentException(sprintf(
                'Attachment group must be string, received %s',
                is_object($group) ? get_class($group) : gettype($group)
            ));
        }

        $this->group = $group;

        return $this;
    }
public function setGroup ( $ group ) { if ( ! is_string ( $ group ) && $ group !== null ) { throw new InvalidArgumentException ( sprintf ( 'Attachment group must be string, received %s' , is_object ( $ group ) ? get_class ( $ group ) : gettype ( $ group ) ) ) ; } $ this -> group = $ group ; return $ this ; }
Set the widget's attachment grouping.

Prevents the relationship from deleting all non related attachments.

@param  string $group The group identifier.
@throws InvalidArgumentException If the group key is invalid.
@return self
Set the widget s attachment grouping .