Re: Model Association without Foreign key (Cake 1.18)
It's 1.19 btw... but think that won't mather much. On Feb 6, 10:16 am, Bo-oz [EMAIL PROTECTED] wrote: Hi, I would like to enrich a model with data from another model. However they are not directly related. The value that needs to be fetched from the other model lies within a certain time-range. I've searched the groups and have found that you should be able to indicate that the foreignKey = false... but still I cannot get it to work! I have the following model for Pirce class Price extends AppModel { var $hasOne = array('Vatrate'= array('conditions' ='1=1', 'foreignKey'=false) ); } The idea should be to finally make a condition which bounds the date, so that I know which VAT-rate should be taken. Any thoughts on how to use a model association (if this is possible) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Model Association without Foreign key (Cake 1.18)
Hi, I would like to enrich a model with data from another model. However they are not directly related. The value that needs to be fetched from the other model lies within a certain time-range. I've searched the groups and have found that you should be able to indicate that the foreignKey = false... but still I cannot get it to work! I have the following model for Pirce class Price extends AppModel { var $hasOne = array('Vatrate'= array('conditions' ='1=1', 'foreignKey'=false) ); } The idea should be to finally make a condition which bounds the date, so that I know which VAT-rate should be taken. Any thoughts on how to use a model association (if this is possible) --~--~-~--~~~---~--~~ 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: Model Association without Foreign key (Cake 1.18)
I was afraid of that... I've read some other reply's by you in another thread, and based on that, I was already expecting that this could not be done. Would be great functionality though. On Feb 6, 10:37 am, AD7six [EMAIL PROTECTED] wrote: On Feb 6, 10:23 am, Bo-oz [EMAIL PROTECTED] wrote: It's 1.19 btw... but think that won't mather much. I think you need (a v recent) 1.2 for that to work unless you do it yourself hth, AD --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Problem with findAllThreaded... bug or not?
Hi, I'm Using CakePHP 1.19. I have a menu table with the following fields: - id - parent_id - name - link For sorting purposes, I would like the menu to show ordered by Name ASC. When I use: $this-Menu-findAllThreaded('','','name ASC'); The resulting array only contains siblings with a name that is higher in the alfabet then the name of the parent. For instance id: 1 parent_id: null name: beta id:2 parent_id: 1 name: alfa id:3 parent_id:1 name:kappa Will result in parent 1 having only ONE sibling, id:3 kappa. A solitution to this behaviour is adding the parent_id to the Order By clause as the primary sort condition: $this-Menu-findAllThreaded('','',array('parent_id','name'); I'm wondering if this is expectable behaviour... any thoughts? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
beforeDelete() filter and model dependancies
Hi, I'm using a datamodel in which I do not want records to be actually deleted. All I want is that a flag is set that the record has been marked for deletion. therefor I am using a beforeDelete() filter that saves the field of the current record like this: ?php function beforeDelete() { $this-Model-saveField('delete',true); return false } ? The return false makes sure that the record is not physically deleted. But I would like Cake to try and delete the records from dependant tables. It seems however that returning false in this filter stops any further processing. Is this correct? Is there a way to avoid this behaviour? --~--~-~--~~~---~--~~ 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: beforeDelete() filter and model dependancies
thx :) On Feb 4, 4:55 pm, grigri [EMAIL PROTECTED] wrote: Search for the 'Soft Deletable' behavior by Mariano Iglesias. It's on the bakery, and also on his Cake Syrup website. On Feb 4, 3:12 pm, Bo-oz [EMAIL PROTECTED] wrote: Hi, I'm using a datamodel in which I do not want records to be actually deleted. All I want is that a flag is set that the record has been marked for deletion. therefor I am using a beforeDelete() filter that saves the field of the current record like this: ?php function beforeDelete() { $this-Model-saveField('delete',true); return false } ? The return false makes sure that the record is not physically deleted. But I would like Cake to try and delete the records from dependant tables. It seems however that returning false in this filter stops any further processing. Is this correct? Is there a way to avoid this behaviour? --~--~-~--~~~---~--~~ 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: Admin Routes in combination with standard routes.
Works like a charm! care to elaborate? thanks adam. On Jan 30, 3:08 pm, Adam Royle [EMAIL PROTECTED] wrote: Try this: $Route-connect('/'.CAKE_ADMIN, array('controller' = 'products', 'action' = 'index', CAKE_ADMIN = CAKE_ADMIN)); On Jan 30, 11:46 pm, Bo-oz [EMAIL PROTECTED] wrote: Hi I've defined the CAKE_ADMIN line in /app/config/core.php this works great. Only calling:http://domain.com/adminresolvesin a error that the controller was not defined. Therefor I've tried to define a new route: $Route-connect('/admin', array('controller' = 'products', 'action' = 'index')); only this does not call the method admin_index of the products controller. Using admin_index as the action gives me an error that indicates that the method isn't accessible this way. What i would like to do is provide easy access to the backend by using a simple link instead ofhttp://www.domain.com/admin/users(/login) An y thoughts? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
View this page Cake Apps/Sites In The Wild
Added my site. http://www.iamin.com thanks... happy baking. Click on http://groups.google.com/group/cake-php/web/cake-apps-sites-in-the-wild - or copy paste it into your browser's address bar if that doesn't work. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---