php - Relate to another table without using prefixes -


so have task of creating mobile version of existing website built different framework didnt started.

the client wants use cakephp on it. im using cakephp 2.5.7. question is. there way relate table existing table without using prefixes?

to make more clear have on controller

public function index(){     $this->loadmodel('bulletin');     $bulletins = $this->bulletin->find('all'); } 

in model

class bulletin extends appmodel{      var $usetable = 'bulletin';      var $hasmany = array(         'bulletincomment' => array(             'classname'   => 'bulletincomment',             'foreignkey'  => 'bulletinid',         ),     ); } 

but bulletincomment table on database has no prefix. , showing error on page

error: table bulletincomments model bulletincomment not found in datasource default. 

i tried creating bulletincomment model this

class bulletincomment extends appmodel{      var $usetable = 'bulletincomment';    } 

but no avail. im still getting error. possible use relation without adding prefixes?

assuming prefixes setup in database connection (/app/config/database.php) can override 1 table if add model:

public $tableprefix = ''; 

or remove prefix in connection , add models need it, depending on faster.


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -