Fix to workaround bug
https://github.com/doctrine/doctrine2/issues/5941 Change-Id: I809e0860437e46abf15b18f3f96605bb83e6577b
This commit is contained in:
parent
338615ed86
commit
2832dc3e76
@ -61,7 +61,7 @@ class AbstractMemberSerializer extends SilverStripeSerializer
|
||||
|
||||
if(in_array('affiliations', $relations)){
|
||||
$res = [];
|
||||
foreach ($member->getAffiliations() as $affiliation){
|
||||
foreach ($member->getCurrentAffiliations() as $affiliation){
|
||||
$res[] = SerializerRegistry::getInstance()
|
||||
->getSerializer($affiliation)
|
||||
->serialize('organization');
|
||||
|
@ -54,10 +54,10 @@ class Member extends SilverstripeBaseModel
|
||||
*/
|
||||
public function getCurrentAffiliations(){
|
||||
$criteria = Criteria::create()
|
||||
->where(Criteria::expr()->eq("isCurrent", true))
|
||||
->andWhere(Criteria::expr()->eq("endDate", null))
|
||||
->where(Criteria::expr()->eq("is_current", true))
|
||||
->andWhere(Criteria::expr()->eq("end_date", null))
|
||||
->orderBy([
|
||||
"startDate" => Criteria::ASC,
|
||||
"start_date" => Criteria::ASC,
|
||||
]);
|
||||
|
||||
return $this->affiliations->matching($criteria);
|
||||
|
Loading…
x
Reference in New Issue
Block a user