View Single Post
  #2  
Old 03-29-2016, 04:46 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 125,738
Kyttias is on a distinguished road
Default

PHP Code:
if ($adopt->getCompanion() != "nocompanion") { 
    
$item = new StockItem($adopt->getCompanion()); 
    
$item->append(1$mysidia->user->username); 

How's that?

Personally, rather than creating getWhatever() functions I'd rather just set the values to public variables at the top of the owned adoptables class file, and then just use $adopt->companion instead of $adopt->getCompanion() but that's just my preference. That way I don't have to write a function and it looks less clunky.
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.

Last edited by Kyttias; 03-29-2016 at 04:49 PM.
Reply With Quote