Last active
August 8, 2017 14:19
-
-
Save alpha1125/723921da68749328c751f1aae78f4d52 to your computer and use it in GitHub Desktop.
doctrine filter vs match.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$criteria = Criteria::create()->where(Criteria::expr()->eq("id", $listId)); | |
$desiredList = $property->getLists()->matching($criteria); | |
## $desiredList is an empty ArrayCollection() | |
## The following works: | |
$list = $property->getLists()->filter(function (PropertyList $listResult) use ($listId) { | |
return ($listResult->getId() == $listId); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment