Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add readOne() method in the DataReaderInterface #39

Closed
roxblnfk opened this issue Jun 12, 2020 · 1 comment · Fixed by yiisoft/yii-cycle#36
Closed

Add readOne() method in the DataReaderInterface #39

roxblnfk opened this issue Jun 12, 2020 · 1 comment · Fixed by yiisoft/yii-cycle#36
Labels
status:ready for adoption Feel free to implement this issue.

Comments

@roxblnfk
Copy link
Member

I suggest adding a method for reading a single element in the DataReaderInterface.
This method will work in much the same way as the read() method with a limit of 1, but will return not the collection of elements, but the first element.

interface DataReaderInterface
{
    public const DEFAULT_LIMIT = 10;

    public function withLimit(int $limit);
    public function read(): iterable;
    public function readOne();
}
@samdark
Copy link
Member

samdark commented Jun 13, 2020

I am fine with having it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready for adoption Feel free to implement this issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants