RE: softDelete, would anyone find useful enough....

2007-02-07 Thread Mariano Iglesias

I'm not into including this on the CakePHP core, it is so simple to add it
by yourself that it is pointless adding it to the core.

Soft deletes are for certain occasions while hard deletes are the most
common thing.

Other than that thanks for taking the effort to propose a new functionality
to the community.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Jon Bennett
Enviado el: Miércoles, 07 de Febrero de 2007 08:08 a.m.
Para: cake-php@googlegroups.com
Asunto: softDelete, would anyone find useful enough

... to add to core?

At present if a table has created and modifed fields, these are
updated automatically, we could expand on this to include a deleted
field, then add an extra param to Model-del($id,$cascade,$soft)  and
if $soft is true, it would first check the field exists with hasField,
and then set the datetime.


--~--~-~--~~~---~--~~
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: softDelete, would anyone find useful enough....

2007-02-07 Thread nate

Why not write it up as a behavior?

Mariano Iglesias wrote:
 I'm not into including this on the CakePHP core, it is so simple to add it
 by yourself that it is pointless adding it to the core.

 Soft deletes are for certain occasions while hard deletes are the most
 common thing.

 Other than that thanks for taking the effort to propose a new functionality
 to the community.

 -MI

 ---

 Remember, smart coders answer ten questions for every question they ask.
 So be smart, be cool, and share your knowledge.

 BAKE ON!

 blog: http://www.MarianoIglesias.com.ar


 -Mensaje original-
 De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
 de Jon Bennett
 Enviado el: Miércoles, 07 de Febrero de 2007 08:08 a.m.
 Para: cake-php@googlegroups.com
 Asunto: softDelete, would anyone find useful enough

 ... to add to core?

 At present if a table has created and modifed fields, these are
 updated automatically, we could expand on this to include a deleted
 field, then add an extra param to Model-del($id,$cascade,$soft)  and
 if $soft is true, it would first check the field exists with hasField,
 and then set the datetime.


--~--~-~--~~~---~--~~
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: softDelete, would anyone find useful enough....

2007-02-07 Thread CreepieDeCrapper

I definitely have the use for this functionality in 2 of my current
projects. Although, I only need to perform the soft delete on certain
tables, and not everywhere. What would be the best way to make this
functionality modular so I can quickly and easily utilize either a
soft or hard delete within my controller?


--~--~-~--~~~---~--~~
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: softDelete, would anyone find useful enough....

2007-02-07 Thread mariano.iglesias

See this ticket:

https://trac.cakephp.org/ticket/664

And also follow message thread in there.

-MI


--~--~-~--~~~---~--~~
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: softDelete, would anyone find useful enough....

2007-02-07 Thread Mariano Iglesias

As nate pointed out you can use Model behaviours to achieve this:

http://api.cakephp.org/1.2/classModelBehavior.html

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Jon Bennett
Enviado el: Miércoles, 07 de Febrero de 2007 03:05 p.m.
Para: cake-php@googlegroups.com
Asunto: Re: softDelete, would anyone find useful enough

as you'll most likely want to do this on a model basis (eg, one Model
would not want both delete and soft delete), just change the deletes
in those controllers to softDelete()


--~--~-~--~~~---~--~~
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: softDelete, would anyone find useful enough....

2007-02-07 Thread Langdon Stevenson

Hi Jon

I am just about to implement this exact functionality in an application. 
  Like you, I also think that it would be a logical piece of 
functionality to include in the Cake core.  After all, soft delete has 
exactly the same set of issues attached to it (cascading for instance) 
as does regular delete.

Mariano says that it is so simple to implement that you wouldn't put it 
in the CakePHP core.  Why then put delete in the core?  Surely it would 
be just as simple to implement?

What attracts me to Cake is that stuff like deleting is simple to do. 
As a consumer of Cake (as opposed to a developer), I would find soft 
deletes a useful feature to have built in.

Obviously this is just my personal opinion / 2 cents worth etc :-)  I 
would be interested to hear the reasons for not including this sort of 
functionality.  Is is a matter of bloat?

Regards,
Langdon


Jon Bennett wrote:
 ... to add to core?
 
 I've just reworked some core cake code (very slightly!), so I could
 have a cascadable, softDelete function, and have realised that if cake
 followed 1 more convention, it could be very easy to add this into the
 core.

--~--~-~--~~~---~--~~
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: softDelete, would anyone find useful enough....

2007-02-07 Thread Langdon Stevenson

I have just looked through Jon's code for softDeleting and am now even 
more in favor of this functionality going into the core.

My PHP knowledge and my Cake knowledge are not good enough to be able to 
implement what Jon has done.  Certainly not without a couple of weeks 
work.  This is definitely the sort of functionality that I would not 
like to have to re-implement in every project.

Regards,
Langdon


Langdon Stevenson wrote:
 Hi Jon
 
 I am just about to implement this exact functionality in an application. 

--~--~-~--~~~---~--~~
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: softDelete, would anyone find useful enough....

2007-02-07 Thread Langdon Stevenson

Hi Jon

 I can't really take credit for it - it's basically a variant of the
 existing delete methods, 

I think that is the point :-)  Ok, its a small modification, but it 
would have taken me a long time to figure out.


 This is definitely the sort of functionality that I would not  like to have 
 to re-implement in every project.
 
 well, you don't, do once, and add to your app_model - I always have
 unbindAll (and now softDelete) in my app_model when i start.

Understood, but this is why I agree with you that it should be in the 
core.

If you are including something in appModel (I always have the expects 
function for unbinding) for every project, doesn't this suggest that it 
really does belong in core?

I can see that my appModel is quickly growing to be quite large, 
therefore making it a less convenient file to work with.

Regards,
Langdon


--~--~-~--~~~---~--~~
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: softDelete, would anyone find useful enough....

2007-02-07 Thread Jon Bennett

 Understood, but this is why I agree with you that it should be in the
 core.

we're both ignoring mariano's post earlier which linked to a ticket in
track stating it would be here for 1.2 - couldn't find it in the API,
so guess it's on its way some time soon.

jon

-- 


jon bennett
t: +44 (0) 1225 341 039 w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

--~--~-~--~~~---~--~~
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: softDelete, would anyone find useful enough....

2007-02-07 Thread Langdon Stevenson

 Understood, but this is why I agree with you that it should be in the
 core.
 
 we're both ignoring mariano's post earlier which linked to a ticket in
 track stating it would be here for 1.2 - couldn't find it in the API,
 so guess it's on its way some time soon.

Good point :-)  Lets wait for 1.2 then.

Regards,
Langdon

--~--~-~--~~~---~--~~
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: softDelete, would anyone find useful enough....

2007-02-07 Thread nate

Just because there is an enhancement ticket that has been left open
does not necessarily mean that something is going to be added to the
core.  In all likelihood, it will *not* be added to the core, as the
Behaviors API provides a more-than-sufficient interface to plug this
functionality in with an external class.

On Feb 7, 4:59 pm, Jon Bennett [EMAIL PROTECTED] wrote:
  Understood, but this is why I agree with you that it should be in the
  core.

 we're both ignoring mariano's post earlier which linked to a ticket in
 track stating it would be here for 1.2 - couldn't find it in the API,
 so guess it's on its way some time soon.

 jon

 --

 jon bennett
 t: +44 (0) 1225 341 039 w:http://www.jben.net/
 iChat (AIM): jbendotnet Skype: jon-bennett


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---