Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix unconsistent behavior with "get" and "is"
- Loading branch information
Showing
1 changed file
with
3 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -604,6 +604,9 @@ protected function getAttribute($object, $item, array $arguments = array(), $typ | |
} else { | ||
$methods = get_class_methods($object); | ||
} | ||
// sort values to have consistent behavior, so that "get" methods win precedence over "is" methods | ||
sort($methods); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
stof
Member
|
||
|
||
$cache = array(); | ||
|
||
foreach ($methods as $method) { | ||
|
I have an issue because of this. My entity have two methods, getExpired() and isExpired() and when in twig view I use object.expired|date isExpired() is triggered and date displaed as 1970....