Model.class.phpとBag.class.phpがあり、BagクラスはModelクラスを拡張します。
しかし、Bag.class.phpで定義された関数を呼び出そうとすると、「未定義の関数fill_entity()を呼び出して」という致命的なエラーが表示されます。
bag.class.php:
class Bag extends Model{
public function __construct($table_name){
$this->table_name = $table_name;
}
public function fill_entity($row){
$this->id = $row['bagID'];
$this->name = $row['bagName'];
$this->price = $row['bagPrice'];
$this->url = $row['bagURL'];
$this->img_url = $row['bagImgURL'];
$this->mall_id = $row['mallID'];
$this->brand_id = $row['brandID'];
}
これが私がこの関数を呼び出す私のphpページです:
$bag = new Bag($bagtype);
$bag.fill_entity($row); <---- error on this line.