Beispiel #1
0
 /**
  * @see parent::drop()
  */
 public function drop()
 {
     if (parent::drop()) {
         File::detach($this);
         $Document = new Product_Document();
         foreach ($Document->findList(array('ProductId = ' . $this->Id)) as $Document) {
             $Document->drop();
         }
         $Example = new Product_Example();
         foreach ($Example->findList(array('ProductId = ' . $this->Id)) as $Example) {
             $Example->drop();
         }
         $Image = new Product_Image();
         foreach ($Image->findList(array('ProductId = ' . $this->Id)) as $Image) {
             $Image->drop();
         }
         $Model = new Product_Model();
         foreach ($Model->findList(array('ProductId = ' . $this->Id)) as $Model) {
             $Model->drop();
         }
         $Unit = new Product_Unit();
         foreach ($Unit->findList(array('ProductId = ' . $this->Id)) as $Unit) {
             $Unit->drop();
         }
         return true;
     }
     return false;
 }