What I need, when delete one Product delete all Subproduct and Images
pro all Subproduct with images, which dont save to database but as file
in any directory. In db image is seva id image, name image file, type.

Is any way how call method for delete images from diractory, when is
call method for dependet Subproduct and Image?

Product Model:
-------------------------------
class Product extends AppModel
{
    var $name = 'Product';
    var $belongsTo = array('Brand', 'Section');
    var $hasMany = array('Subproduct'  =>
                       array('className'             => 'Subproduct',
                                                         'dependent'    =>  
true,
                                                         'order'                
 => 'Subproduct.sort ASC')
                                );

class Subproduct extends AppModel
{
    var $name = 'Subproduct';

        var $belongsTo = 'Product';
        var $hasMany = array('Image'  =>
                       array('className'             => 'Image',
                                                 'dependent'    =>  true));
       /*
        var $hasMany = array('ShoppingCart'  =>
                       array('className'             => 'ShoppingCart',
                                                 'dependent'    =>  true));
        */
}

THX


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

Reply via email to