`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` = '10004'
On 12 Gru, 11:16, Zwift [EMAIL PROTECTED] wrote:
Thanks
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] wrote:
Can you paste here your SQL Dumb, and models code
I
, 10:16 am, Zwift [EMAIL PROTECTED] wrote:
Thanks.
After more investigation I found out that bake didn't add uses
LocalNumber to LocalAccounts Controller
However after I added this
It displays LocalAccounts for each existing LocalNumber...
Example
I have LocalNumbers 10001, 10002, 10003
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 in bakers - brands example
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 used only hasOne associacion, but I want to have also
back
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
and later on in this method it checks
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(
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(
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).
On Dec 11, 9:28 am, Zwift [EMAIL
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.cakephp.org/1.2
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 Dec 11, 12:35 pm, Zwift [EMAIL PROTECTED] wrote:
After some
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
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
13 matches
Mail list logo