public function Channel::__toString in Rocket.Chat 8.2
File
- modules/
rocket_chat_api/ src/ RocketChat/ Element/ Channel.php, line 131
Class
Namespace
Drupal\rocket_chat_api\RocketChat\ElementCode
public function __toString() {
$ret = "#" . $this
->getChannelName();
if ($this
->hasType(self::PRIVATE_CHANNEL)) {
$ret .= " [Private Channel]";
}
if ($this
->hasType(self::PUBLIC_CHANNEL)) {
$ret .= " [Public Channel]";
}
$perms = "";
if ($this
->hasType(self::READ)) {
$perms .= "READABLE,";
}
if ($this
->hasType(self::WRITE)) {
$perms .= "WRITABLE,";
}
if ($this
->hasType(self::BROADCAST)) {
$perms .= "BROADCAST,";
}
$perms = rtrim($perms, ",");
$ret .= " ({$perms})";
return $ret;
}