この独自の記述モデルをコントローラーにロードできない理由がわかりません。モデルコード:
class Storage extends CI_Model
{
function __construct()
{
parent::__construct();
$this->load->database();
}
function getStorageByID( $storageID, $accountID = -1 )
{
$query = $this->db->select('*')->from('storage')->where('storageID', $storageID);
if ($accountID != -1)
$query->where('storageAccountID', $accountID);
return $this->finishQuery( $query );
}
function getStorageByAccount( $accountID )
{
$query = $this->db->select('*')->from('storage')->where('storageAccountID', $accountID)->limit( $limit );
return $this->finishQuery( $query );
}
function finishQuery( $query )
{
$row = $query->get()->result();
return objectToArray($row);
}
}
ロードと実行に使用されるコントローラー内のコード:
$this->load->model('storage'); // Line 147
$storageDetails = $storage->getStorageByAccount( $userData['accountID'] ); // Line 148
エラー:
Message: Undefined variable: storage
Filename: controllers/dashboard.php
Line Number: 148
Fatal error: Call to a member function getStorageByAccount() on a non-object in /home/dev/concept/application/controllers/dashboard.php on line 148
モデル ロード コマンドを var_dump しようとしましたが、NULL しか返されません。
前もって感謝します。