Skip to content

Commit

Permalink
Version 2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
a.pushkarev committed Jul 30, 2022
1 parent 2e44053 commit ef396ba
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
+ [Чистые данные](#Чистые-данные)
+ [Отформатированные данные](#Отформатированные-данные)
+ [Свой формат данных](#Свой-формат-данных)
+ [Группировка по ключам](#Группировка-по-ключам)
4. [Автор](#Автор)
5. [Лицензия](#Лицензия)

Expand Down Expand Up @@ -250,6 +251,13 @@ public function formatData(): array
public function customFormat(callable $callback): array
```

### Группировка по ключам
По умолчанию отформатированные данные группируются по ключам:
```
ym:s:, ym:pv:, ym:ad:, ym:sp:
```
Если вам требуется добавить/удалить группировку, то воспользуйтесь `setCombineKeys` у `Response`

## Автор
[Alexander Pushkarev](https://github.com/axp-dev), e-mail: [[email protected]](mailto:[email protected])

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Yandex Metrika API Library",
"homepage": "https://github.com/axp-dev/ya-metrika",
"keywords": ["yandex", "metrika", "api"],
"version": "2.1.0",
"version": "2.2.0",
"license": "MIT",
"authors": [
{
Expand Down
10 changes: 10 additions & 0 deletions src/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ public function __construct(private array $data)
{
}

public function getCombineKeys(): array
{
return $this->combineKeys;
}

public function setCombineKeys(array $combineKeys): void
{
$this->combineKeys = $combineKeys;
}

public function formatData(): array
{
if ($this->cachedFormat) {
Expand Down

0 comments on commit ef396ba

Please sign in to comment.