The issue is with this line:
PHP Code:
$gender = $adopt->getGender();
The $adopt from item functions is not an instance of class OwnedAdoptable, but an instance of StdClass with properties of the same name as the database columns. This has a historical reason, as the model class for Adoptable and OwnedAdoptable were available after Mys v1.3.2, while item functions existed back since Mys v1.3.0.
So the fix is very simple, change this line to the code below:
PHP Code:
$gender = $adopt->gender;
Lemme know if it works.