Zend Db Магический метод DependentRowset - PullRequest
0 голосов
/ 06 января 2012

Я пытаюсь использовать магический метод Zend Db findBy (), но он выдает мне эту ошибку:

Application error

Exception information:

Message: File "Game.php" does not exist or class "Game" was not found in the file

Stack trace:

#0 C:\Zend\ZendServer\share\ZendFramework\library\Zend\Db\Table\Row\Abstract.php(872): Zend_Db_Table_Row_Abstract->_getTableFromString('Game')
#1 C:\Zend\ZendServer\share\ZendFramework\library\Zend\Db\Table\Row\Abstract.php(1154): Zend_Db_Table_Row_Abstract->findDependentRowset('Game', NULL, NULL)
#2 C:\Zend\Apache2\htdocs\dev.gamenomad.com\application\controllers\GameController.php(125): Zend_Db_Table_Row_Abstract->__call('findGame', Array)
#3 C:\Zend\Apache2\htdocs\dev.gamenomad.com\application\controllers\GameController.php(125): Zend_Db_Table_Row->findGame()
#4 C:\Zend\ZendServer\share\ZendFramework\library\Zend\Controller\Action.php(516): GameController->platformAction()
#5 C:\Zend\ZendServer\share\ZendFramework\library\Zend\Controller\Dispatcher\Standard.php(295): Zend_Controller_Action->dispatch('platformAction')
#6 C:\Zend\ZendServer\share\ZendFramework\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#7 C:\Zend\ZendServer\share\ZendFramework\library\Zend\Application\Bootstrap\Bootstrap.php(97): Zend_Controller_Front->dispatch()
#8 C:\Zend\ZendServer\share\ZendFramework\library\Zend\Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#9 C:\Zend\Apache2\htdocs\dev.gamenomad.com\public\index.php(26): Zend_Application->run()
#10 {main}  
Request Parameters:

array (
  'controller' => 'game',
  'action' => 'platform',
  'x' => '2',
  'module' => 'default',
)

Похоже, он не обнаруживает Game.php, даже если он существует внутри /application/models/DbTable/Game.php

.

Существуют ли какие-либо правила или исключения, которые я пропускаю?

Это мой код

public function platformAction()
    {
        // action body
        $platform = intval($this->_request->getParam('x'));
        $platformTable = new Application_Model_DbTable_Platform();

        $xbox360 = $platformTable->find($platform)->current();

        //$games = $xbox360->findDependentRowset('Application_Model_DbTable_Game');
        $games = $xbox360->findGame();
        if(isset($games))
        {
            if(count($games)>0)
            {
                foreach($games as $game)
                {
                    echo "{$game->name}<br />";
                }
            }
        }
    }
...