|
@@ 89-96 (lines=8) @@
|
| 86 |
|
* |
| 87 |
|
* @return Resource |
| 88 |
|
*/ |
| 89 |
|
public function load($id, $params = []) |
| 90 |
|
{ |
| 91 |
|
$resource = str_replace(static::RESOURCE_REPLACE, $this->getTwitterAds()->getAccountId(), static::RESOURCE); |
| 92 |
|
$resource = str_replace(static::RESOURCE_ID_REPLACE, $id, $resource); |
| 93 |
|
$response = $this->getTwitterAds()->get($resource, $params); |
| 94 |
|
|
| 95 |
|
return $this->fromResponse($response->getBody()->data); |
| 96 |
|
} |
| 97 |
|
|
| 98 |
|
/** |
| 99 |
|
* Reloads all attributes for the current object instance from the API. |
|
@@ 216-222 (lines=7) @@
|
| 213 |
|
* Deletes the current object instance depending on the |
| 214 |
|
* presence of `object->getId()`. |
| 215 |
|
*/ |
| 216 |
|
public function delete() |
| 217 |
|
{ |
| 218 |
|
$resource = str_replace(static::RESOURCE_REPLACE, $this->getTwitterAds()->getAccountId(), static::RESOURCE); |
| 219 |
|
$resource = str_replace(static::RESOURCE_ID_REPLACE, $this->getId(), $resource); |
| 220 |
|
$response = $this->getTwitterAds()->delete($resource); |
| 221 |
|
$this->fromResponse($response->getBody()->data); |
| 222 |
|
} |
| 223 |
|
|
| 224 |
|
/** |
| 225 |
|
* @return array |