Hi! I think I know why this is happening. Are the two codes you posted the entire files, or just a section?
I was a bit confused with this quite some time ago. Did you construct myadopts like this? I suspect that your were missing the "catch" statement in the _construct function.
PHP Code:
<?php
use Resource\Native\Integer;
use Resource\Native\String;
class MyadoptsController extends AppController{
const PARAM = "aid";
const PARAM2 = "confirm";
private $adopt;
private $image;
public function __construct(){
parent::__construct("member");
$mysidia = Registry::get("mysidia");
if($this->action != "index"){
try{
$this->adopt = new OwnedAdoptable($mysidia->input->get("aid"));
if($this->adopt->getOwner() != $mysidia->user->username) throw new NoPermissionException("permission");
$this->image = $this->adopt->getImage("gui");
}
catch(AdoptNotfoundException $pne){
$this->setFlags("nonexist_title", "nonexist");
}
}
}
public function index(){
$mysidia = Registry::get("mysidia");
$total = $mysidia->db->select("owned_adoptables", array("aid"), "owner = '{$mysidia->user->username}'")->rowCount();
$pagination = new Pagination($total, 10, "myadopts");
$pagination->setPage($mysidia->input->get("page"));
$stmt = $mysidia->db->select("owned_adoptables", array("aid"), "owner = '{$mysidia->user->username}' ORDER BY totalclicks LIMIT {$pagination->getLimit()},{$pagination->getRowsperPage()}");
$this->setField("pagination", $pagination);
$this->setField("stmt", new DatabaseStatement($stmt));
}
public function add(){
$mysidia = Registry::get("mysidia");
}
}
?>