@@ -55,7 +55,7 @@ public function __construct(
5555 $ api_key = '' ,
5656 $ delivery_token = '' ,
5757 $ environment = '' ,
58- $ config = array ('region ' => '' , 'live_preview ' => array ())
58+ $ config = array ('region ' => '' , 'branch ' => '' , ' live_preview ' => array ())
5959 ) {
6060
6161 if ($ config && $ config !== "undefined " && array_key_exists ('region ' , $ config ) && $ config ['region ' ] !== "undefined " && $ config ['region ' ] =="eu " ) {
@@ -65,7 +65,8 @@ public function __construct(
6565 'stack ' , array ('api_key ' => $ api_key ,
6666 'access_token ' => $ delivery_token ,
6767 'environment ' => $ environment ,
68- 'region ' => $ config ['region ' ] ?? '' )
68+ 'region ' => $ config ['region ' ] ?? '' ,
69+ 'branch ' => $ config ['branch ' ] ?? '' )
6970 );
7071 $ this ->environment = $ this ->header ['environment ' ];
7172 unset($ this ->header ['environment ' ]);
@@ -225,7 +226,7 @@ public function getPort()
225226 /**
226227 * This function sets API Key.
227228 *
228- * @param string $api_key - Name of Environment
229+ * @param string $api_key - API Key
229230 *
230231 * @return Stack
231232 * */
@@ -238,7 +239,7 @@ public function setAPIKEY($api_key = '')
238239 /**
239240 * This function sets Delivery Token.
240241 *
241- * @param string $delivery_token - Name of Environment
242+ * @param string $delivery_token - Delivery Token
242243 *
243244 * @return Stack
244245 * */
@@ -291,6 +292,31 @@ public function getEnvironment()
291292 return $ this ->environment ;
292293 }
293294
295+
296+ /**
297+ * This function sets Branch.
298+ *
299+ * @param string $branch - Name of branch
300+ *
301+ * @return Stack
302+ * */
303+ public function setBranch ($ branch = '' )
304+ {
305+ Utility::validateInput ('branch ' , $ branch );
306+ $ this ->header ['branch ' ] = $ branch ;
307+ return $ this ;
308+ }
309+
310+ /**
311+ * This function returns Branch.
312+ *
313+ * @return string
314+ * */
315+ public function Branch ()
316+ {
317+ return $ this ->header ['branch ' ];
318+ }
319+
294320 /**
295321 * This call returns comprehensive information of all
296322 * the content types available in a particular stack in your account.
0 commit comments