11<?php
2+ /**
3+ * ADNRecipes.php
4+ * App.net PHP library
5+ * https://github.com/jdolitsky/AppDotNetPHP
6+ *
7+ * This class contains some simple recipes for publishing to App.net.
8+ */
29
310require_once "AppDotNet.php " ;
411
@@ -39,6 +46,11 @@ class ADNBroadcastMessageBuilder extends ADNRecipe {
3946 // stores the attachment filename
4047 private $ _attachment = null ;
4148
49+ /**
50+ * Sets the destination channel ID. Required.
51+ * @param string $channel_id The App.net Channel ID to send to. Get this
52+ * from the web publisher tools if you don't have one.
53+ */
4254 public function setChannelID ($ channel_id ) {
4355 $ this ->_channel_id = $ channel_id ;
4456
@@ -49,6 +61,12 @@ public function getChannelID() {
4961 return $ this ->_channel_id ;
5062 }
5163
64+ /**
65+ * Sets the broadcast headline. This string shows up in the push
66+ * notifications which are sent to mobile apps, and is the title
67+ * displayed in the UI.
68+ * @param string $headline A short string for a headline.
69+ */
5270 public function setHeadline ($ headline ) {
5371 $ this ->_headline = $ headline ;
5472
@@ -59,6 +77,12 @@ public function getHeadline() {
5977 return $ this ->_headline ;
6078 }
6179
80+ /**
81+ * Sets the broadcast text. This string shows up as a description
82+ * on the broadcast detail page and in the "card" view in the
83+ * mobile apps. Can contain links.
84+ * @param string $text Broadcast body text.
85+ */
6286 public function setText ($ text ) {
6387 $ this ->_text = $ text ;
6488
@@ -69,6 +93,12 @@ public function getText() {
6993 return $ this ->_text ;
7094 }
7195
96+ /**
97+ * Sets a flag which allows links to be parsed out of body text in
98+ * [Markdown](http://daringfireball.net/projects/markdown/)
99+ * format.
100+ * @param bool $parseMarkdownLinks Parse markdown links.
101+ */
72102 public function setParseMarkdownLinks ($ parseMarkdownLinks ) {
73103 $ this ->_parseMarkdownLinks = $ parseMarkdownLinks ;
74104
@@ -79,6 +109,10 @@ public function getParseMarkdownLinks() {
79109 return $ this ->_parseMarkdownLinks ;
80110 }
81111
112+ /**
113+ * Sets a flag which causes bare URLs in body text to be linkified.
114+ * @param bool $parseLinks Parse links.
115+ */
82116 public function setParseLinks ($ parseLinks ) {
83117 $ this ->_parseLinks = $ parseLinks ;
84118
@@ -89,6 +123,10 @@ public function getParseLinks() {
89123 return $ this ->_parseLinks ;
90124 }
91125
126+ /**
127+ * Sets the URL the broadcast should link to.
128+ * @param string $readMoreLink Read more link URL.
129+ */
92130 public function setReadMoreLink ($ readMoreLink ) {
93131 $ this ->_readMoreLink = $ readMoreLink ;
94132
@@ -99,6 +137,12 @@ public function getReadMoreLink() {
99137 return $ this ->_readMoreLink ;
100138 }
101139
140+ /**
141+ * Sets the filename of a photo associated with a broadcast.
142+ * Probably requires the php-imagick extension. File will be
143+ * uploaded to App.net.
144+ * @param string $photo Photo filename.
145+ */
102146 public function setPhoto ($ photo ) {
103147 $ this ->_photo = $ photo ;
104148
@@ -109,6 +153,11 @@ public function getPhoto() {
109153 return $ this ->_photo ;
110154 }
111155
156+ /**
157+ * Sets the filename of a attachment associated with a broadcast.
158+ * File will be uploaded to App.net.
159+ * @param string $attachment Attachment filename.
160+ */
112161 public function setAttachment ($ attachment ) {
113162 $ this ->_attachment = $ attachment ;
114163
@@ -119,6 +168,9 @@ public function getAttachment() {
119168 return $ this ->_attachment ;
120169 }
121170
171+ /**
172+ * Sends the built-up broadcast.
173+ */
122174 public function send () {
123175 $ parseLinks = $ this ->_parseLinks || $ this ->_parseMarkdownLinks ;
124176 $ message = array (
0 commit comments