Re: after adding an hasOne relation to model it is not available in my view anymore

2010-08-22 Thread Tomfox Wiranata
hi everyone...thx for your answers..i appreciate it

when i debug this happens

Array
(
[id] = 213
[user_id] = 1
[title] = werwr
[flyer_path] = ../lin/123/123_big.jpg
[flyer_path_thumb] = ../lin/123/123_thumb.jpg
[description] = werwrewrwerew
[created] = 2010-08-19 22:20:20
[locked] = -1
[date_locked] = -00-00 00:00:00
)

it does not seem empty
i have tried it without dependent too...no luck!


On 20 Aug., 16:28, Dan Heberden danheber...@gmail.com wrote:
 Is debugging on so you can see the sql error? It's having trouble
 'finding one' - which is one generative sql call so if IT fails the
 whole bloody thing fails and you get an empty array.

 On Aug 19, 2:55 pm, Marcos  Mendonça marc...@gmail.com wrote:

  have you tried without the 'dependent' = true attribute?

  On Aug 19, 3:58 pm, Tomfox Wiranata tomfox.wiran...@gmail.com wrote:

   hi,

   weird thing. i declare a hasOne relation:

   class User extends AppModel
   {
       var $name = 'User';

       var $hasOne = array(
                   'Link' = array(
                           'className' = 'Link',
                           'dependent' = true
                   )
           );

   }

   suddenly i am having undefined index everywhere i use that model in
   my views, like:

   span class=profiledata?php echo $user['firstname']; ?/span

   if i delete the hasOne part it works fine and the view shows the user
   data...what the heck did i do wrong? looking forward to your
   feedback..

   big big thx

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: after adding an hasOne relation to model it is not available in my view anymore

2010-08-22 Thread j.blotus
your array is supposed to look like this
Array
 ('User'=array(
     [id] = 213
     [user_id] = 1
     [title] = werwr
     [flyer_path] = ../lin/123/123_big.jpg
     [flyer_path_thumb] = ../lin/123/123_thumb.jpg
     [description] = werwrewrwerew
     [created] = 2010-08-19 22:20:20
     [locked] = -1
     [date_locked] = -00-00 00:00:00
 ));

On Aug 22, 11:17 am, Tomfox Wiranata tomfox.wiran...@gmail.com
wrote:
 hi everyone...thx for your answers..i appreciate it

 when i debug this happens

 Array
 (
     [id] = 213
     [user_id] = 1
     [title] = werwr
     [flyer_path] = ../lin/123/123_big.jpg
     [flyer_path_thumb] = ../lin/123/123_thumb.jpg
     [description] = werwrewrwerew
     [created] = 2010-08-19 22:20:20
     [locked] = -1
     [date_locked] = -00-00 00:00:00
 )

 it does not seem empty
 i have tried it without dependent too...no luck!

 On 20 Aug., 16:28, Dan Heberden danheber...@gmail.com wrote:



  Is debugging on so you can see the sql error? It's having trouble
  'finding one' - which is one generative sql call so if IT fails the
  whole bloody thing fails and you get an empty array.

  On Aug 19, 2:55 pm, Marcos  Mendonça marc...@gmail.com wrote:

   have you tried without the 'dependent' = true attribute?

   On Aug 19, 3:58 pm, Tomfox Wiranata tomfox.wiran...@gmail.com wrote:

hi,

weird thing. i declare a hasOne relation:

class User extends AppModel
{
    var $name = 'User';

    var $hasOne = array(
                'Link' = array(
                        'className' = 'Link',
                        'dependent' = true
                )
        );

}

suddenly i am having undefined index everywhere i use that model in
my views, like:

span class=profiledata?php echo $user['firstname']; ?/span

if i delete the hasOne part it works fine and the view shows the user
data...what the heck did i do wrong? looking forward to your
feedback..

big big thx

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: after adding an hasOne relation to model it is not available in my view anymore

2010-08-20 Thread Dan Heberden
Is debugging on so you can see the sql error? It's having trouble
'finding one' - which is one generative sql call so if IT fails the
whole bloody thing fails and you get an empty array.


On Aug 19, 2:55 pm, Marcos  Mendonça marc...@gmail.com wrote:
 have you tried without the 'dependent' = true attribute?

 On Aug 19, 3:58 pm, Tomfox Wiranata tomfox.wiran...@gmail.com wrote:



  hi,

  weird thing. i declare a hasOne relation:

  class User extends AppModel
  {
      var $name = 'User';

      var $hasOne = array(
                  'Link' = array(
                          'className' = 'Link',
                          'dependent' = true
                  )
          );

  }

  suddenly i am having undefined index everywhere i use that model in
  my views, like:

  span class=profiledata?php echo $user['firstname']; ?/span

  if i delete the hasOne part it works fine and the view shows the user
  data...what the heck did i do wrong? looking forward to your
  feedback..

  big big thx

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


after adding an hasOne relation to model it is not available in my view anymore

2010-08-19 Thread Tomfox Wiranata
hi,

weird thing. i declare a hasOne relation:

class User extends AppModel
{
var $name = 'User';

var $hasOne = array(
'Link' = array(
'className' = 'Link',
'dependent' = true
)
);
}


suddenly i am having undefined index everywhere i use that model in
my views, like:

span class=profiledata?php echo $user['firstname']; ?/span


if i delete the hasOne part it works fine and the view shows the user
data...what the heck did i do wrong? looking forward to your
feedback..

big big thx

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: after adding an hasOne relation to model it is not available in my view anymore

2010-08-19 Thread Max Dörfler

 Hi,

whats the find call for $user?
what does debug($user); spit out?

Greetings
Max

Am 19.08.2010 20:58, schrieb Tomfox Wiranata:

hi,

weird thing. i declare a hasOne relation:

class User extends AppModel
{
 var $name = 'User';

 var $hasOne = array(
'Link' =  array(
'className' =  'Link',
'dependent' =  true
)
);
}


suddenly i am having undefined index everywhere i use that model in
my views, like:

span class=profiledata?php echo $user['firstname']; ?/span


if i delete the hasOne part it works fine and the view shows the user
data...what the heck did i do wrong? looking forward to your
feedback..

big big thx

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: after adding an hasOne relation to model it is not available in my view anymore

2010-08-19 Thread j.blotus
do this in your view:

pr($user)

What does that array look like?

undefined index means you are trying to reference an array key that
doesn't exist. the format of your $user array has likely changed when
you added the model association.

On Aug 19, 2:58 pm, Tomfox Wiranata tomfox.wiran...@gmail.com wrote:
 hi,

 weird thing. i declare a hasOne relation:

 class User extends AppModel
 {
     var $name = 'User';

     var $hasOne = array(
                 'Link' = array(
                         'className' = 'Link',
                         'dependent' = true
                 )
         );

 }

 suddenly i am having undefined index everywhere i use that model in
 my views, like:

 span class=profiledata?php echo $user['firstname']; ?/span

 if i delete the hasOne part it works fine and the view shows the user
 data...what the heck did i do wrong? looking forward to your
 feedback..

 big big thx

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: after adding an hasOne relation to model it is not available in my view anymore

2010-08-19 Thread Marcos Mendonça
have you tried without the 'dependent' = true attribute?

On Aug 19, 3:58 pm, Tomfox Wiranata tomfox.wiran...@gmail.com wrote:
 hi,

 weird thing. i declare a hasOne relation:

 class User extends AppModel
 {
     var $name = 'User';

     var $hasOne = array(
                 'Link' = array(
                         'className' = 'Link',
                         'dependent' = true
                 )
         );

 }

 suddenly i am having undefined index everywhere i use that model in
 my views, like:

 span class=profiledata?php echo $user['firstname']; ?/span

 if i delete the hasOne part it works fine and the view shows the user
 data...what the heck did i do wrong? looking forward to your
 feedback..

 big big thx

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en