URL can't be hard coded in. The URL is called up in the model using a method (class function) from the URL supplied in the database. Since ownedadoptableviewmodel has functions for this already built in, use those, and make sure that file is in the namespace of the controller. I did also modify getting the base image to write to ownedadoptable DB instead of linking to the adopts image file. If you notice in domainmodel-ownedadoptable, updating the level of any adopt calls a function for updating alternates which will update images.
To get non alts to also write to the ownedadoptables table in the DB, I modified that function with this
I plan to work on this mod when I get over my carpal tunnel issues, which may be awhile. I will help as I can when that time comes.
Code:
public function setCurrentLevel($level, $assignMode = ""){
$this->currentlevel = $level;
if($assignMode == Model::UPDATE){
$this->save("currentlevel", $this->currentlevel);
$this->updateAlternate($assignMode);
}
To get non alts to also write to the ownedadoptables table in the DB, I modified that function with this
Code:
public function updateAlternate($assignMode = "")
{
$alternate = $this->generateAlternate();
if ($alternate) {
$this->imageurl = $alternate->getImage();
$this->alternate = $alternate->getALID();
} else if(!$this->alternate) {
$this->imageurl = $this->getImage();
$this->alternate = 0;
}
if ($assignMode == Model::UPDATE) {
$this->save("imageurl", $this->imageurl);
$this->save("alternate", $this->alternate);
}
}
I plan to work on this mod when I get over my carpal tunnel issues, which may be awhile. I will help as I can when that time comes.