Completed
Push — master ( b86db6...b3547a )
by Sergey
39s
created

HasRelatedTopics::execGetRequest()

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
c 0
b 0
f 0
nc 1
1
<?php
2
3
namespace seregazhuk\PinterestBot\Api\Traits;
4
5
use seregazhuk\PinterestBot\Helpers\UrlBuilder;
6
7
trait HasRelatedTopics
8
{
9
    /**
10
     * Returns a list of related interests
11
     * @param string $interest
12
     * @return array|bool
13
     */
14
    public function getRelatedTopics($interest)
15
    {
16
        return $this->execGetRequest(
17
            [
18
                'interest_name' => $interest,
19
            ],
20
            UrlBuilder::RESOURCE_GET_CATEGORIES_RELATED
21
        );
22
    }
23
24
    /**
25
     * Executes a GET request to Pinterest API.
26
     *
27
     * @param array $requestOptions
28
     * @param string $resourceUrl
29
     * @return array|bool
30
     */
31
    abstract protected function execGetRequest(array $requestOptions = [], $resourceUrl = '');
32
}