Re: Another Associacion Problem hasOne <=> belongsTo

2007-12-12 Thread Zwift
Hell yeah it worked Am I stupid or what?? Thanks for help. Its ok now. On 12 Gru, 13:05, Zwift <[EMAIL PROTECTED]> wrote: > I've noticed another thing > I set my models property to recursive = 2 > but when I echo $model->recursive inside dbo_source read method > its

Re: Another Associacion Problem hasOne <=> belongsTo

2007-12-12 Thread Zwift
No sorry again, my mistake damn... I don't know what to do On 12 Gru, 13:05, Zwift <[EMAIL PROTECTED]> wrote: > I've noticed another thing > I set my models property to recursive = 2 > but when I echo $model->recursive inside dbo_source read method > its equal 0 &

Re: Another Associacion Problem hasOne <=> belongsTo

2007-12-12 Thread Zwift
uestion one why its equal 0 ?? On 12 Gru, 12:20, Zwift <[EMAIL PROTECTED]> wrote: > And the problem with many selects occured probably because I've added > those uses I guess I should not > > On 12 Gru, 12:16, Zwift <[EMAIL PROTECTED]> wrote: > > > Your example

Re: Another Associacion Problem hasOne <=> belongsTo

2007-12-12 Thread Zwift
And the problem with many selects occured probably because I've added those uses I guess I should not On 12 Gru, 12:16, Zwift <[EMAIL PROTECTED]> wrote: > Your example used only hasOne associacion, but I want to have also > back associacion belongsTo > I just noticed that

Re: Another Associacion Problem hasOne <=> belongsTo

2007-12-12 Thread Zwift
or the correct revision and update your version, and you > shouldn't have this issue. > > On Dec 12, 10:16 am, Zwift <[EMAIL PROTECTED]> wrote: > > > Thanks. > > After more investigation I found out that bake didn't add uses > > LocalNumber to LocalA

Re: Another Associacion Problem hasOne <=> belongsTo

2007-12-12 Thread Zwift
unt`.`user_id`, `LocalAccount`.`local_number` FROM `local_accounts` AS `LocalAccount` WHERE `LocalAccount`.`local_number` = '10003' SELECT `LocalAccount`.`id`, `LocalAccount`.`user_id`, `LocalAccount`.`local_number` FROM `local_accounts` AS `LocalAccount` WHERE `LocalAccount`.`local_number` = '10

Re: Another Associacion Problem hasOne <=> belongsTo

2007-12-12 Thread Zwift
; dbconfig to the config file under a different key. > > Code + SQL here :http://openpaste.org/en/4255/ > > (I always have a 'playground' cake app setup on my local machine for > various testing and experimentation) > > On Dec 11, 1:38 pm, Zwift <[EMAIL PROTECTED]&

Re: Another Associacion Problem hasOne <=> belongsTo

2007-12-11 Thread Zwift
han > one db config for the same app so far) and it works fine, even without > the external bit. > > It seems completely transparent, and it's only seeing the sql logs > that you realise it does a separate query, not a join, for the > external association. > > On D

Re: Another Associacion Problem hasOne <=> belongsTo

2007-12-11 Thread Zwift
After some researching I just need to know - is it even possible??? Many people (on IRC) says: yes, sure But hell I cannot make it work even with simples User <-> Profile associacion (from tempdocs) On 11 Gru, 11:56, Zwift <[EMAIL PROTECTED]> wrote: > I think nothttp://api.

Re: Another Associacion Problem hasOne <=> belongsTo

2007-12-11 Thread Zwift
I think not http://api.cakephp.org/1.2/libs_2model_2model_8php-source.html (from line 260) On 11 Gru, 11:44, grigri <[EMAIL PROTECTED]> wrote: > If your models are using different datasources you have to set the > 'external' attribute in the association (I think). > &g

Re: Another Associacion Problem hasOne <=> belongsTo

2007-12-11 Thread Zwift
I've simplified it /* MODELS */ class LocalNumber extends AppModel { var $useDbConfig = 'prepaid'; var $name = 'LocalNumber'; var $hasOne = 'LocalAccount'; } class LocalAccount extends AppModel { var $name = 'LocalAccount'; var $belongsTo = array(

Another Associacion Problem hasOne <=> belongsTo

2007-12-11 Thread Zwift
2 Models FIRST: class LocalNumber extends AppModel { var $useDbConfig = 'prepaid'; var $useTable = 'cards'; var $primaryKey = 'number'; var $displayField = 'number'; var $name = 'LocalNumber'; var $recursive = 2; var $hasOne = array(

Re: Multiple DBs association

2007-11-30 Thread Zwift
Problem is that I don't know how to set up DataSource, because I cannot do associacion between two diferent databases using only models, can I? there is no field for database config name in associacion array. I just read some information that datasources can make you do assosciacions between files

Multiple DBs association

2007-11-30 Thread Zwift
Hello I'm new here, but I was developing with cake for a while now. Now I'm doing bigger project, and I need to work with 2 DBs - one of them is "static" I cannot mess with its structure... So is it possible to create associations between two different databases? I'm searching for some tutorial