Re: Deleting associated records

2013-01-12 Thread Chetan Varshney
Silly mistake-

check spelling of dependent in has many.

On Sat, Jan 12, 2013 at 9:58 AM, amit.sukapur...@gmail.com wrote:

 Hello Everyone,

 I need to delete associated records.

 I have tried but can't figure it out.

 Here is my situation,

 Database,

 questions {id(pk), question, answer}

 options {id(pk), question_id, option_value}

 Models,

 Question

 ..

 public $hasMany = array( 'Option' = array('dependant' = true));

 ..

 Option

 ..

 public $belongsTo = array( 'Question' );

 ..

 Controllers,

 QuestionController

 ..

 public function delete($id = null){

 $this-Question-delete($id,true)

 }

 ..

 Still its not working with deletion. Otherwise everything works fine about
 association.

 Please Help Me.

 --
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP

 ---
 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.
 Visit this group at http://groups.google.com/group/cake-php?hl=en.






-- 
Chetan Varshney
Ektanjali Softwares Pvt Ltd

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Deleting associated records

2013-01-12 Thread amit . sukapure89
Oh Yes !! 
Thanks a lot.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Deleting associated records

2013-01-11 Thread amit . sukapure89
 

Hello Everyone,

I need to delete associated records.

I have tried but can't figure it out.

Here is my situation,

Database,

questions {id(pk), question, answer}

options {id(pk), question_id, option_value}

Models,

Question

..

public $hasMany = array( 'Option' = array('dependant' = true));

..

Option

..

public $belongsTo = array( 'Question' );

..

Controllers,

QuestionController

..

public function delete($id = null){

$this-Question-delete($id,true)

}

..

Still its not working with deletion. Otherwise everything works fine about 
association.

Please Help Me.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.