Is there another way to read foreign data and save it to database?. So
you suggest that I should write another model to write data to my
database?,
I think that the best way is to make index page with 2 buttons, 1
button will use controller and model to get this rss data and another
button will save this data to database? Am I thinging correct?
On 4 Dez., 19:06, Ryan Schmidt <google-2...@ryandesign.com> wrote:
> On Dec 4, 2010, at 11:41, NOOOOB wrote:
>
> > But what about my model configuration?
>
> > <?php
>
> > class News extends AppModel {
> > var $name ='New';
> > var $useTable = false;
> > var $useDbConfig = 'MyDealZ';
> > }
> > ?>
> > This configuration is needed in the tutorial, How rss data will be
> > saved to my local database when model has this configuration?
>
> Hmm, I suppose it won't be.
>
> Seems to me this News model should be exclusively for getting data from Google News. If you also want to have the data locally in your own database, then you might need a separate model for that. After all, you may not want to have the same fields in your database as Google returns in their RSS. You may want to track additional items, or may not care to store about some of the data they send back.
>
> The two models could certainly talk to one another, e.g. when you fetch something from the (Google News) News model, it could insert or update data in your database news model. Or you could turn it around, and make your database news model be the one you usually talk with, and it would return data from your own database, unless the data there is too old, in which case it would talk to the other model to load the data from Google.
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment