| 1 |
<?php |
| 2 |
|
| 3 |
class DeepLApiUsage extends DeepLApi { |
| 4 |
protected $endPoint = 'usage'; |
| 5 |
public $allow_cache = false; |
| 6 |
protected $http_mode = 'GET'; |
| 7 |
|
| 8 |
public function getCurrentCharacterCount() { |
| 9 |
if ( !isset( $this->response ) || !array_key_exists( 'character_count', $this->response ) ) { |
| 10 |
return false; |
| 11 |
} |
| 12 |
return $this->response['character_count']; |
| 13 |
} |
| 14 |
|
| 15 |
public function buildBody( $mode, $endpoint ) { |
| 16 |
|
| 17 |
return false; |
| 18 |
} |
| 19 |
|
| 20 |
public function getCharacterLimit() { |
| 21 |
if ( !isset( $this->response ) || !array_key_exists( 'character_limit', $this->response ) ) { |
| 22 |
return false; |
| 23 |
} |
| 24 |
return $this->response['character_limit']; |
| 25 |
} |
| 26 |
} |