public function setRoles($roles)
    {
        if (!is_array($roles)) {
            $roles = [$roles];
        }

        $this->roles = $roles;

        return $this;
    }
public function setRoles($roles)
    {
        if (!is_array($roles)) {
            $roles = [$roles];
        }

        $this->roles = $roles;

        return $this;
    }
public function setRoles ( $ roles ) { if ( ! is_array ( $ roles ) ) { $ roles = [ $ roles ] ; } $ this -> roles = $ roles ; return $ this ; }
Sets user roles.

@param array|string $roles

@return User
Sets user roles .