From bf8580c9c0dc9e19a203a95d6f4f6e91888b0d01 Mon Sep 17 00:00:00 2001 From: jgedarovich Date: Wed, 8 Mar 2017 12:23:54 -0500 Subject: [PATCH] add accessor for attachments in the SimpleMessage class, plus a conveinence method for checking if a message has any attachmentst at all --- src/CL/Slack/Model/SimpleMessage.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/CL/Slack/Model/SimpleMessage.php b/src/CL/Slack/Model/SimpleMessage.php index c06a2220..4bbbaf27 100644 --- a/src/CL/Slack/Model/SimpleMessage.php +++ b/src/CL/Slack/Model/SimpleMessage.php @@ -107,4 +107,20 @@ public function getText() { return $this->text; } + + /** + * @return array of attachments + */ + public function getAttachments() + { + return $this->attachments; + } + + /** + * @return boolean wether or not this message has attachments + */ + public function hasAttachments() + { + return count($this->attachments) > 0; + } }