Skip to content

Commit a0b3dec

Browse files
Fix docs (#23)
* Fix docs * Update README.md * Fix docs --------- Co-authored-by: Alexey Rogachev <[email protected]>
1 parent 6f3ff7d commit a0b3dec

File tree

6 files changed

+41
-39
lines changed

6 files changed

+41
-39
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p align="center">
22
<a href="https://github.com/yiisoft" target="_blank">
3-
<img src="https://yiisoft.github.io/docs/images/yii_logo.svg" height="100px">
3+
<img src="https://yiisoft.github.io/docs/images/yii_logo.svg" height="100px" alt="Yii">
44
</a>
55
<h1 align="center">Yii Data Cycle</h1>
66
<br>
@@ -32,7 +32,7 @@ composer require yiisoft/data-cycle
3232

3333
## Documentation
3434

35-
- Guide: [English](docs/guide/en/README.md), [Português - Brasil](docs/guide/pt-BR/README.md), [Русский](docs/guide/ru/README.md), [Spanish](docs/guide/es/README.md)
35+
- Guide: [English](docs/guide/en/README.md), [Português - Brasil](docs/guide/pt-BR/README.md), [Spanish](docs/guide/es/README.md), [Русский](docs/guide/ru/README.md)
3636
- [Internals](docs/internals.md)
3737

3838
If you need help or have a question, the [Yii Forum](https://forum.yiiframework.com/c/yii-3-0/63) is a good place for

composer.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
"license": "BSD-3-Clause",
1414
"support": {
1515
"issues": "https://github.com/yiisoft/data-cycle/issues?state=open",
16+
"source": "https://github.com/yiisoft/data-cycle",
1617
"forum": "https://www.yiiframework.com/forum/",
1718
"wiki": "https://www.yiiframework.com/wiki/",
1819
"irc": "ircs://irc.libera.chat:6697/yii",
19-
"chat": "https://t.me/yii3en",
20-
"source": "https://github.com/yiisoft/data-cycle"
20+
"chat": "https://t.me/yii3en"
2121
},
2222
"funding": [
2323
{
@@ -55,7 +55,9 @@
5555
"psr-4": {
5656
"Yiisoft\\Data\\Cycle\\Tests\\": "tests"
5757
},
58-
"files": ["tests/bootstrap.php"]
58+
"files": [
59+
"tests/bootstrap.php"
60+
]
5961
},
6062
"config": {
6163
"sort-packages": true,

docs/guide/en/entity-reader.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
# EntityReader
1+
# EntityReader Class
22

33
`EntityReader` allows to securely pass select-queries from repository to user runtime.
44
By select-query we assume an instance of `\Cycle\ORM\Select` or `\Cycle\Database\Query\SelectQuery`.
55

66
You need to know the following about `EntityReader`:
77

8-
* `EntityReader` implements `IteratorAggregate`.
8+
- `EntityReader` implements `IteratorAggregate`.
99
It allows using `EntityReader` instance in `foreach`.
10-
* Using `EntityReader` you can adjust select-query:
10+
- Using `EntityReader` you can adjust select-query:
1111
- Add `Limit` and `Offset` manually or using `OffsetPaginator`
1212
- Specify sorting. Note that `EntityReader` sorting does
1313
not replace initial query sorting but adds sorting on top of it.
1414
Each next `withSort()` call is replacing `EntityReader` sorting options.
1515
- Apply filter. Filtration conditions in `EntityReader` also, do not replace filtration conditions
1616
in initial query, but adds conditions on top of it. Therefore, by using filtration in `SeletecDataReader`
1717
you can only refine the selection, but NOT expand.
18-
* `EntityReader` queries database only when you actually read the data.
19-
* In case you're using `read()`, `readOne()` or `count()`, data will be cached by `EntityReader`.
20-
* The `count()` method returns the number of elements without taking limit and offset into account.
21-
* In case you want to avoid caching, use `getIterator()`. Note that if cache is already there, `getIterator()`
18+
- `EntityReader` queries database only when you actually read the data.
19+
- In case you're using `read()`, `readOne()` or `count()`, data will be cached by `EntityReader`.
20+
- The `count()` method returns the number of elements without taking limit and offset into account.
21+
- In case you want to avoid caching, use `getIterator()`. Note that if cache is already there, `getIterator()`
2222
uses it.
2323

2424
## Examples
@@ -152,6 +152,7 @@ function index(ArticleRepository $repository)
152152
->withSort(Sort::any()->withOrder(['published_at' => 'asc']));
153153
}
154154
```
155+
155156
You may refine query conditions with filters. This filtering conditions are adding to original select query conditions, but NOT replace them.
156157

157158
```php

docs/guide/es/entity-reader.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
# EntityReader
1+
# Clase EntityReader
22

33
`EntityReader` es una herramienta útil para transferir de forma segura las solicitudes de selección del repositorio en tiempo de ejecución del usuario.
44

55
Una solicitud de selección se refiere a una instancia de una de las clases: ``CycleORM\Select`` o ``Spiral\Database\Query\SelectQuery``.
66

77
Lo que hay que saber sobre `EntityReader`:
88

9-
* La clase `EntityReader` implementa la interfaz `IteratorAggregate`. Esto permite utilizar el objeto `EntityReader` en un bucle `foreach`.
10-
* Con `EntityReader` se puede ajustar la consulta de selección:
9+
- La clase `EntityReader` implementa la interfaz `IteratorAggregate`. Esto permite utilizar el objeto `EntityReader` en un bucle `foreach`.
10+
- Con `EntityReader` se puede ajustar la consulta de selección:
1111
- Establezca `Limit` y `Offset` manualmente con `OffsetPaginator`.
1212
- La ordenación por `EntityReader` no sustituye la ordenación en la consulta original, sólo la complementa. Sin embargo, cada llamada posterior al método `withSort()` sustituirá la configuración de clasificación del objeto `EntityReader`.
1313
- Las condiciones del filtro `EntityReader` tampoco sustituyen al de filtrado en la consulta original, solo la complementan. Así, que al filtrar el objeto `EntityReader`, sólo puede ajustar la selección pero no ampliarla.
14-
* `EntityReader` no extrae los datos de la base de datos de una sola vez. Sólo accede a la base de datos cuando se consultan esos datos.
15-
* Si utiliza los métodos `read()` y `readOne()` para leer los datos, entonces `EntityReader` lo almacenará en una caché. El resultado de una llamada a `count()` también se almacena en caché.
16-
* El método `count()` devuelve el número de todos los elementos de la muestra sin tener en cuenta las restricciones `Limit` y `Offset`.
17-
* Si no quieres que los datos se almacenen en caché, utiliza el método `getIterator()`. Sin embargo, si la caché ya está llena, `getIterator()` devolverá el contenido de la caché.
14+
- `EntityReader` no extrae los datos de la base de datos de una sola vez. Sólo accede a la base de datos cuando se consultan esos datos.
15+
- Si utiliza los métodos `read()` y `readOne()` para leer los datos, entonces `EntityReader` lo almacenará en una caché. El resultado de una llamada a `count()` también se almacena en caché.
16+
- El método `count()` devuelve el número de todos los elementos de la muestra sin tener en cuenta las restricciones `Limit` y `Offset`.
17+
- Si no quieres que los datos se almacenen en caché, utiliza el método `getIterator()`. Sin embargo, si la caché ya está llena, `getIterator()` devolverá el contenido de la caché.
1818

1919
## Ejemplos
2020

docs/guide/pt-BR/entity-reader.md

+13-14
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
# EntityReader
1+
# Classe EntityReader
22

33
`EntityReader` permite passar com segurança consultas de seleção do repositório para o tempo de execução do usuário.
44
Por consulta selecionada, assumimos uma instância de `\Cycle\ORM\Select` ou `\Cycle\Database\Query\SelectQuery`.
55

66
Você precisa saber o seguinte sobre `EntityReader`:
77

8-
* `EntityReader` implementa `IteratorAggregate`.
8+
- `EntityReader` implementa `IteratorAggregate`.
99
Ele permite usar a instância `EntityReader` em `foreach`.
10-
* Usando `EntityReader` você pode ajustar a consulta de seleção:
11-
* Adicione manualmente `Limit` e `Offset` ou usando `OffsetPaginator`
12-
* Especifique a classificação. Observe que a classificação `EntityReader`
13-
não substitui a classificação da consulta inicial, mas adiciona uma classificação np topo dela.
10+
- Usando `EntityReader` você pode ajustar a consulta de seleção:
11+
- Adicione manualmente `Limit` e `Offset` ou usando `OffsetPaginator`
12+
- Especifique a classificação. Observe que a classificação `EntityReader`
13+
não substitui a classificação da consulta inicial, mas adiciona uma classificação no topo dela.
1414
Cada próxima chamada `withSort()` substitui as opções de classificação `EntityReader`.
15-
* Aplicar filtro. As condições de filtragem em `EntityReader` também não substituem as condições de filtragem
15+
- Aplicar filtro. As condições de filtragem em `EntityReader` também não substituem as condições de filtragem
1616
na consulta inicial, mas adiciona condições a ela. Portanto, usando filtragem no `SeletecDataReader`
1717
você só pode refinar a seleção, mas NÃO expandir.
18-
* `EntityReader` consulta o banco de dados somente quando você realmente lê os dados.
19-
* Caso você esteja usando `read()`, `readOne()` ou `count()`, os dados serão armazenados em cache por `EntityReader`.
20-
* O método `count()` retorna o número de elementos sem levar em consideração o limite e o deslocamento.
21-
* Caso você queira evitar o cache, use `getIterator()`. Observe que se o cache já estiver lá, `getIterator()`
18+
- `EntityReader` consulta o banco de dados somente quando você realmente lê os dados.
19+
- Caso você esteja usando `read()`, `readOne()` ou `count()`, os dados serão armazenados em cache por `EntityReader`.
20+
- O método `count()` retorna o número de elementos sem levar em consideração o limite e o deslocamento.
21+
- Caso você queira evitar o cache, use `getIterator()`. Observe que se o cache já estiver lá, `getIterator()`
2222
vai usá-lo.
2323

2424
## Exemplos
2525

2626
Vamos implementar um repositório para trabalhar com tabela de artigos. Queremos um método para obter artigos públicos `findPublic()` mas
27-
não retornaria uma coleção de artigos prontos ou uma consulta selecionada. Em vez disso, retornar `EntityReader`:
27+
ue não retorne uma coleção de artigos prontos ou uma consulta selecionada. Em vez disso, retorne `EntityReader`:
2828

2929
```php
3030
use Yiisoft\Data\Cycle\Data\Reader\EntityReader;
@@ -152,7 +152,6 @@ function index(ArticleRepository $repository)
152152
->withSort(Sort::any()->withOrder(['published_at' => 'asc']));
153153
}
154154
```
155-
156155
Você pode refinar as condições de consulta com filtros. Essas condições de filtragem são adicionadas às condições de consulta de seleção originais, mas NÃO as substituem.
157156

158157
```php
@@ -174,4 +173,4 @@ class ArticleRepository extends \Cycle\ORM\Select\Repository
174173
```
175174

176175
Use filtros do pacote [yiisoft/data](https://github.com/yiisoft/data) ou qualquer outro, tendo previamente escrito
177-
os manipuladores (processadores) apropriados para eles.
176+
os handlers(processors) apropriados para eles.

docs/guide/ru/entity-reader.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
Что нужно знать о `EntityReader`:
99

10-
* Класс `EntityReader` реализует интерфейс `IteratorAggregate`.
10+
- Класс `EntityReader` реализует интерфейс `IteratorAggregate`.
1111
Это позволяет использовать объект `EntityReader` в цикле `foreach`.
12-
* С помощью `EntityReader` вы можете корректировать переданный select-запрос:
12+
- С помощью `EntityReader` вы можете корректировать переданный select-запрос:
1313
- Выставлять `Limit` и `Offset` вручную или с помощью `OffsetPaginator`.
1414
- Задавать сортировку. Но учтите, что сортировка `EntityReader`
1515
не заменяет сортировку в исходном запросе, а лишь дополняет её.
@@ -18,12 +18,12 @@
1818
- Применять фильтр. Условия фильтрации `EntityReader` также не заменяют настройки
1919
фильтрации в исходном запросе, а дополняют её. Таким образом, фильтрацией
2020
в объекте `EntityReader` вы можете только уточнить выборку, но не расширить.
21-
* `EntityReader` не вытягивает данные из БД сразу.
21+
- `EntityReader` не вытягивает данные из БД сразу.
2222
Обращение к БД происходит только тогда, когда эти данные запрашиваются.
23-
* Если вы будете использовать методы `read()` и `readOne()` для чтения данных,
23+
- Если вы будете использовать методы `read()` и `readOne()` для чтения данных,
2424
то `EntityReader` сохранит их в кеше. Кешируется также и результат вызова `count()`.
25-
* Метод `count()` возвращает кол-во всех элементов выборки без учёта ограничений `Limit` и `Offset`.
26-
* Если вы не хотите, чтобы данные были записаны в кеш, то используйте метод `getIterator()`.
25+
- Метод `count()` возвращает кол-во всех элементов выборки без учёта ограничений `Limit` и `Offset`.
26+
- Если вы не хотите, чтобы данные были записаны в кеш, то используйте метод `getIterator()`.
2727
Однако если кеш уже заполнен, то `getIterator()` вернёт содержимое кеша.
2828

2929
## Примеры

0 commit comments

Comments
 (0)