Proper Association
I'm having a hard time how I should approach this but let me explain. I have some reports for customers that are uploaded every day such as regarding status (i.e. usage). Sometimes these reports are very large and I cannot contact all in one day. *Reports* id | date | created Then each item in the Report sorted through and then saved to the Items database. *Items* id | report_id | name | bid | usage | created *Followups* id | item_id | note | bid | created What I need is when I pull the report and display the Items in a table for any given Report to display if the customer has been contacted within the last month. I can't do hasAndBelongsToMany relationship because with each report/day brings new items where the data has changed (i.e. id and usage) but the only thing remaining the same is the BID. Would I need to Join tables? Any Assistance would be appreciated. -- Like Us on FacekBook 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.
Controller Named Folders
Stupid question, I am working on a project and have a database named folders and the model folder and controller folders_controller.php i keep getting Fatal error: Call to undefined method Folder::findAll() in E:\Program Files\xampp\htdocs\project\app\controllers\folders_controller.php on line 6 When i renamed everythign to tag and tags it worked properly, is there a conflict when using the name folder --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Association Problem
sweet, THANK YOU! :) On Feb 17, 6:59 pm, Grant Cox [EMAIL PROTECTED] wrote: Change your Intinerary's Event association to var $hasMany = array('Event' = array('className'= 'Event') ); in your itineraries/view action, have something like function view($id) { $this-Itinerary-recursive = 1; $itinerary = $this-Itinerary-read(null, $id); $this-set('itinerary', $itinerary); } and in your view, do a print_r($itinerary) to see how the associations come through in your data array. Or, just bake the whole lot - it can make all your models, controllers and views, just make sure you tell it the right associations. On Feb 17, 11:26 am, strykstaguy [EMAIL PROTECTED] wrote: I have tried to read the manual and look at examples but I am having a hard time with associations. For one, I have a three tables. Trips, Itineraries, Events Each has one Itinerary, Each Itinerary has many events. What i really want right now is to connect my Itineraries to Events, Currently when i display my itineraries it repeats them 6 times instead of twice (the number of itineraries i have right now). I want once i select an itinerary is to view the events that match that itinerary. itinerary.php *** ? class Itinerary extends AppModel { Var $name = 'Itinerary'; var $hasOne = array('Event' = array('className'= 'Event', 'conditions' = '', 'order'= '', 'dependent'= false, 'foreignKey' = 'itinerary_id' ) ); var $validate = array( 'title' = VALID_NOT_EMPTY, 'creator' = VALID_NOT_EMPTY, 'when' = VALID_NOT_EMPTY ); } ? *** events.php ** ? class Event extends AppModel { Var $name = 'Event'; var $belongsTo = array('Itinerary' = array('className' = 'Itinerary', 'conditions' = '', 'order' = '', 'foreignKey' = 'itinerary_id' ) ); var $validate = array( 'what' = VALID_NOT_EMPTY, 'where' = VALID_NOT_EMPTY, 'andwhen' = VALID_NOT_EMPTY ); } ? * What it all comes down to is I know how to connect them with HasMany and BelongsTo but i don't know how to actually display the events info in the 'View' of my itineraries. Any Help?- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Association Problem
I have tried to read the manual and look at examples but I am having a hard time with associations. For one, I have a three tables. Trips, Itineraries, Events Each has one Itinerary, Each Itinerary has many events. What i really want right now is to connect my Itineraries to Events, Currently when i display my itineraries it repeats them 6 times instead of twice (the number of itineraries i have right now). I want once i select an itinerary is to view the events that match that itinerary. itinerary.php *** ? class Itinerary extends AppModel { Var $name = 'Itinerary'; var $hasOne = array('Event' = array('className'= 'Event', 'conditions' = '', 'order'= '', 'dependent'= false, 'foreignKey' = 'itinerary_id' ) ); var $validate = array( 'title' = VALID_NOT_EMPTY, 'creator' = VALID_NOT_EMPTY, 'when' = VALID_NOT_EMPTY ); } ? *** events.php ** ? class Event extends AppModel { Var $name = 'Event'; var $belongsTo = array('Itinerary' = array('className' = 'Itinerary', 'conditions' = '', 'order' = '', 'foreignKey' = 'itinerary_id' ) ); var $validate = array( 'what' = VALID_NOT_EMPTY, 'where' = VALID_NOT_EMPTY, 'andwhen' = VALID_NOT_EMPTY ); } ? * What it all comes down to is I know how to connect them with HasMany and BelongsTo but i don't know how to actually display the events info in the 'View' of my itineraries. Any Help? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: What editor do you use for CakePHP?
Notepad2 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Finally a good Editor for Windows
I do like it, a lot! It has a few small things missing (e.g. Undo/Redo) of course those will come later, but I am hoping for a portable version, which I highly doubt buy I guess I will stick Notepad2. On Jan 24, 6:18 am, Mandy [EMAIL PROTECTED] wrote: Well, this post is not about asking a question, but about sharing an editor that I recently found. You can read more about it here:http://mandysingh.blogspot.com/2007/01/finally-good-editor-for-window... This is going to be having CakePHP support very soon and is really kickass (trust me - it's TextMate for windows). Thanks, Mandy. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---