У меня тонкий контроллер, который я использую, который вызывает методы из толстой модели. Когда я вызываю метод, который находится в моей толстой модели, я получаю предупреждения / ошибки ниже. Похоже, что мой контроллер пытается запросить метод. Любая помощь в этом с благодарностью.
Warning (512): SQL Error: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'testMe' at line 1 [CORE/cake/libs/model/datasources/dbo_source.php, line 684]
Это ошибка, которую я вижу в журнале запросов:
testMe 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'testMe' at line 1
Я заглянул в свою модель, чтобы диагностировать эту проблему.
Это текущее состояние моей модели (user_entity_license.php):
class UserEntityLicense extends UserAgentAppModel {
var $name = 'UserEntityLicense';
var $primaryKey = 'license_id';
var $actsAs = array('Containable');
var $belongsTo = array('UserEntity' => array('className' => 'UserEntity','foreignKey' => 'entity_id'));
public function testMe()
{
return 'This is a test';
}
}
Это текущее состояние моего контроллера (user_entity_licenses_controller.php):
<?php
class UserEntityLicensesController extends UserAgentAppController {
var $name = "UserEntityLicenses";
var $uses = array('UserEntityLicense','UserEntity');
function expiringLicenses()
{
debug($this->UserEntityLicense->testMe());
}
}