Ich habe mir ein kleines Module geschrieben, welches mir ein paar Veranstaltungen anzeigen/verwalten soll. Die metadata.php sieht folgendermaßen aus:
<?php
$sMetadataVersion = '1.1';
$aModule = array(
'id' => 'chEvents',
'title' => 'chEvents',
'lang' =>'de',
'description' => array(
'de' => 'bla',
'en' => 'blubb'
),
'version' => '1.0',
'author' => 'foo',
'email' => '[email protected]',
'url' => 'foobar.de',
'files' => array(
//core
'chEventsTrigger' => 'ch/events/core/chevents.php',
//admin controllers
'chEvents' => 'ch/events/application/controllers/admin/chevents.php',
'chEvents_List' => 'ch/events/application/controllers/admin/chevents_list.php',
'chEvents_Main' => 'ch/events/application/controllers/admin/chevents_main.php',
//models
'chEvent_Model' => 'ch/events/application/models/chevent_model.php',
),
'templates' => array(
'chevents.tpl' => 'ch/events/views/admin/tpl/chevents.tpl',
'chevents_list.tpl' => 'ch/events/views/admin/tpl/chevents_list.tpl',
'chevents_main.tpl' => 'ch/events/views/admin/tpl/chevents_main.tpl',
),
'events' => array(
'onActivate' => 'chEventsTrigger::onActivate'
)
);
Hier noch die Inhalte von den Dateien ‘chevent_model.php’ und ‘chevents_list.php’
chevent_model.php:
<?php
class chEvent_Model extends oxI18n
{
protected $_sClassName = 'chevent_model';
public function __construct()
{
parent::__construct();
$this->init( 'chEvents_List' );
}
}
chevents_list.php:
<?php
class chEvents_List extends oxAdminList
{
protected $_sListClass = 'chevent_model';
protected $_sThisTemplate = 'chevents_list.tpl';
protected function _buildSelectString( $oListObject = null )
{
$sSql = parent::_buildSelectString($oListObject);
$sSql = 'SELECT * FROM `chevents` WHERE 1';
return $sSql;
}
}
Wenn ich nun im Backend mein Modul ansteuere erhalte ich im EXCEPTION.LOG folgenden Fehler:
oxSystemComponentException-oxException (time: 2015-09-21 23:34:27): [0]: EXCEPTION_SYSTEMCOMPONENT_CLASSNOTFOUND
Stack Trace: #0 G:\xampp\htdocs\oxid\core\oxutilsobject.php(188): oxUtilsObject->_getObject('oxsystemcompone...', 0, Array)
#1 [internal function]: oxUtilsObject->oxNew('oxSystemCompone...')
#2 G:\xampp\htdocs\oxid\core\oxfunctions.php(348): call_user_func_array(Array, Array)
#3 G:\xampp\htdocs\oxid\core\oxutilsobject.php(178): oxNew('oxSystemCompone...')
#4 [internal function]: oxUtilsObject->oxNew('chevent_model')
#5 G:\xampp\htdocs\oxid\core\oxfunctions.php(348): call_user_func_array(Array, Array)
#6 G:\xampp\htdocs\oxid\core\oxlist.php(355): oxNew('chevent_model')
#7 G:\xampp\htdocs\oxid\application\controllers\admin\oxadminlist.php(779): oxList->getBaseObject()
#8 G:\xampp\htdocs\oxid\application\controllers\admin\oxadminlist.php(221): oxAdminList->getItemList()
#9 G:\xampp\htdocs\oxid\core\oxshopcontrol.php(471): oxAdminList->render()
#10 G:\xampp\htdocs\oxid\core\oxshopcontrol.php(353): oxShopControl->_render(Object(chEvents_List))
#11 G:\xampp\htdocs\oxid\core\oxshopcontrol.php(126): oxShopControl->_process('chevents_list', NULL, NULL, NULL)
#12 G:\xampp\htdocs\oxid\core\oxid.php(40): oxShopControl->start()
#13 G:\xampp\htdocs\oxid\index.php(26): Oxid::run()
#14 G:\xampp\htdocs\oxid\admin\index.php(27): require_once('G:\xampp\htdocs...')
#15 {main}
Faulty component --> chevent_model
---------------------------------------------
Ich bekomme also gesagt dass die Model-Klasse nicht gefunden werden kann. Aber wieso, was habe ich beim Einbinden falsch gemacht?