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

Implement Countable interface for all Listings #6962

Merged

Conversation

BlackbitDevs
Copy link
Contributor

@BlackbitDevs BlackbitDevs commented Aug 17, 2020

This PR implements PHP's Countable interface for all Listings, so you can do something like this:

$listing = new Listing();
$listing->addConditionParam('column = ?', 123);
if(count($listing) === 0) {
  echo "No entries found";
}

Internally the getTotalCount() method of the Listing DAO gets called. Most of them already had this method - where it was missing this PR adds it.

@brusch brusch requested a review from dvesh3 August 20, 2020 12:44
@brusch brusch added this to the 6.8.0 ("Summer Ale") milestone Aug 20, 2020
models/GridConfigShare/Listing/Dao.php Outdated Show resolved Hide resolved
models/Dependency.php Outdated Show resolved Hide resolved
lib/Model/Listing/AbstractListing.php Show resolved Hide resolved
models/ImportConfigShare/Listing/Dao.php Outdated Show resolved Hide resolved
@dvesh3 dvesh3 merged commit 009a5aa into pimcore:master Aug 25, 2020
@dvesh3
Copy link
Contributor

dvesh3 commented Aug 25, 2020

@BlackbitNeueMedien thanks a lot! 🙏

roland4432 pushed a commit to roland4432/pimcore that referenced this pull request Aug 31, 2020
* implement Countable interface for all Listings

* implement Countable interface for all Listings

* implement Countable interface for all Listings

* implement Countable interface for all Listings

* implement Countable interface for all Listings
@dkarlovi
Copy link
Contributor

I just came to report this issue as a feature request and it's already done! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants