I have the following $input :
elements: array:2 [
0 => Tournament {
id: 1
amountStaking: Price {
value: 2500
currency: "EUR"
}
}
1 => Tournament {
id: 2
amountStaking: Price {
value: 2500
currency: "EUR"
}
}
]
What I want to achieve is a function that will return an object or false
depending of the "equality" of the $amountStaking
property of each Tournament
. In the previous input, it should return the "common" Price object :
Price {
value: 2500
currency: "EUR"
}
But if one of the $currency
value is "USD" for example, it should return false
.