Re: Unable to save related table information

2010-01-15 Thread koala kid
y( >> >>>         "Location" => array( >> >>>         "className" => "Location" >> >>> ) >> >>> ) >> >>> $assoc  =       "belongsTo" >> >>> $model  =       array( >

Re: Unable to save related table information

2010-01-15 Thread John Andersen
->__backAssociation, $this->{$assoc}); > >>>                 unset ($this->__backAssociation[$model]); > > >>> Model::unbindModel() - CORE/cake/libs/model/model.php, line 561 > >>> RentalsController::edit() - APP/controllers/rentals_controller.php, line

Re: Unable to save related table information

2010-01-15 Thread koala kid
unset ($this->__backAssociation[$model]); >>> >>> Model::unbindModel() - CORE/cake/libs/model/model.php, line 561 >>> RentalsController::edit() - APP/controllers/rentals_controller.php, line >>> 91 >>> Object::dispatchMethod() - CORE/cake/libs/ob

Re: Unable to save related table information

2010-01-15 Thread koala kid
4 >> [main] - APP/webroot/index.php, line 88 >> >> It looks like I still haven't got my head around this ORM thing. Have I >> set >> up my associations correctly? >> >> Thanks for your help. >> > [snip] > > Check out the new CakePHP Questi

Re: Unable to save related table information

2010-01-15 Thread John Andersen
You probably get the warning due to the following: [code] class Rate extends AppModel { var $name = 'Rate'; var $belongsTo = 'Rentals'; } [/code] Observe that you have given your Rental model as Rentals in the belongsTo association! Fix that and the warning should go away. Enjoy,

Re: Unable to save related table information

2010-01-15 Thread koala kid
          [Rate/s2_week] => >>>             [Rate/s2_month] => >>>             [Rate/s3_title] => >>>             [Rate/s3_day] => >>>             [Rate/s3_week] => >>>             [Rate/s3_month] => >>>            

Re: Unable to save related table information

2010-01-15 Thread koala kid
>>             [Rate/s4_month] => >>             [Rate/extra_info] => >>             [rental_short_thumb] => holder.gif >>         ) >> >> ) >> >> >> >> John Andersen-6 wrote: >> >> > How does your data look like before the save

Re: Unable to save related table information

2010-01-15 Thread John Andersen
Yes, your data is not CakePHP compatible. The Rental looks find, but it also includes the Rate. The Rate should be at the same level as Rental, and should look like this: [Rate] => Array ( [0] => Array ( [title] => 1 [day] => ... ) [1] => Ar

Re: Unable to save related table information

2010-01-14 Thread koala kid
lassName'=> 'Rate', >>'dependent'=> true >>) >>); >>var $belongsTo = array( >>'Location' => array( >> 'className' => 'Location', &g

Re: Unable to save related table information

2010-01-14 Thread koala kid
       => 'city' >>        ) >>    ); >> >> } >> >> ?> >> >> class Rate extends AppModel >> { >>        var $name = 'Rate'; >> >>        var $belongsTo = 'Rentals'; >> >> } >&

Re: Unable to save related table information

2010-01-14 Thread Nadal
7;className' => 'Location', >'fields'=> 'city' >) >); > > } > ?> > > class Rate extends AppModel > { > var $name = 'Rate'; > >var $belongsTo = 

Re: Unable to save related table information

2010-01-13 Thread John Andersen
= 'Rentals'; > > } > > And my save looks like this: > > $this->Rental->saveAll($this->data) > > However only data to the Rental table is being saved and not to the Rate > table. Can anyone tell me what I am missing. I don't have a contro

Unable to save related table information

2010-01-13 Thread koala kid
to the Rental table is being saved and not to the Rate table. Can anyone tell me what I am missing. I don't have a controller for Rates as there are no direct functions to run against them, does this matter? Thanks. -- View this message in context: http://old.nabble.com/Unable-to-save

Re: ORM Help -> Unable to save related table information

2010-01-13 Thread Alexandru Ciobanu
On 1/13/2010 4:10 AM, koala kid wrote: $this->Rental->saveAll($this->data) http://book.cakephp.org/view/75/Saving-Your-Data It's all there. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because

ORM Help -> Unable to save related table information

2010-01-12 Thread koala kid
Hey all, using ORM for the first time and I'm having trouble getting my associations all worked out. Here's a basic overview of my models: Rentals -> Property with whole bunch of fields Rates -> Belongs to Rentals LocationsPage -> Belongs to Rentals My code looks like this: array(