Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7091477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:11:24+00:00 2026-05-28T08:11:24+00:00

I have a plugin with a model called profile. Also I have a profile

  • 0

I have a plugin with a model called profile. Also I have a profile model in app/model folder, which contains a function getProfileDetails. This function I am calling from the AppController, using the following code

function beforeRender(){if ($this->isAuthorized())
{ 
  $this->loadModel('Profile');
  $this->set('ownProfile', $this->Profile->getProfileDetails($this->Auth->user('id')));
}

}

Whenver I access the plugin through the url, Im getting getting the following error
Syntax error or access violation: 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 ‘getProfileDetails’ at line 1
/lib/Cake/Model/Datasource/DboSource.php(436): PDOStatement->execute(Array)
/lib/Cake/Model/Datasource/DboSource.php(403): DboSource->_execute(‘getProfileDetai…’, Array)

If I give the same function in Plugin/model/profile, everything is working. How to tell cake to take the App/model/profile model in loadmodel ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T08:11:25+00:00Added an answer on May 28, 2026 at 8:11 am

    Cake 2.0 and previous versions do not support duplicate Model/Controller names. The fact that such a setup was working in 1.3 and lower was an unintended side-effect unknown to the developers. Cake loads all the classes, from plugins and the actual application. So a duplicate classname anywhere in you application is bound to mess things up.

    Support for duplicate classnames will likely be added in Cake 3.0 as this version willy rely on PHP 5.3 which, in turn, has support for namespaces needed to implement the ability to create duplicate classnames.

    The only workaround I know of is renaming your plugin’s controllers, models and views, by prefixing the plugin name to the files and classnames, for example. If the plugin uses the same database tables as the application you’ll have to use the $useTable model attribute to point the renamed models to the right database tables.

    Some background is covered in this bug report.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this from tinymce and i called it before calling jquery.. <script type=text/javascript
I essentially have the same goal as in this question: Calling a jQuery plugin
For example I have this gem called Authlogic-openid, that plugin is outdated, no longer
I have a sort of plug-in model in which various complex user controls are
I have findbugs plugin for eclipse which when run on my project will show
I have a plugin for an RCP app that uses BIRT. I have a
I have a plugin that is loaded by this application.. This plugin calls some
I have a model called Vote that gets changed very frequently (people voting on
In Cakephp2.0 I have a model named Club and I'm accessing it from ClubsController.
I have a generic function that returns URLs. (It's a plugin function that returns

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.