Oops, my bad, wrong behavior (although the mentioned one is quite
useful, too). Here's the correct one:
Automatically verify foreign keys in CakePHP: http://josh.ch/wordpress/?p=63
On Thu, Feb 24, 2011 at 5:33 PM, Joshua Muheim wrote:
> I have added this behavior to my Subversion repository and
I have added this behavior to my Subversion repository and created a
small blog article about it... I hope someone finds this useful.
Automatically prevent records with depending children from being deleted:
http://josh.ch/wordpress/?p=80
On Fri, Nov 5, 2010 at 9:46 AM, Joshua Muheim wrote:
> It
It's done. :-)
orphansProtectableOptions = array_merge(array(
), $settings);
}
/**
* ???
*/
function beforeValidate(&$Model) {
$valid = true;
foreach($Model->belongsTo as $model => $settings) {
$foreignKey = $settings['foreignKey'];
$foreignKeyValue = $Model->d
On Thu, Nov 4, 2010 at 5:57 AM, psybear83 wrote:
> Hi everybody
>
> Before creating a behavior myself I wanted to ask this (see title).
>
> I only found this:
> http://ask.cakephp.org/questions/view/how_to_check_the_validness_of_a_foreign-key_must_contained_in_primary-key_list
>
> ...but there's n
Hi everybody
Before creating a behavior myself I wanted to ask this (see title).
I only found this:
http://ask.cakephp.org/questions/view/how_to_check_the_validness_of_a_foreign-key_must_contained_in_primary-key_list
...but there's no solution for the problem.
If nothing like this exists yet, I