Advertisement
VladimirsBudkins

Imagescatalog

Mar 20th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. <?php
  2.  
  3. class Imagescatalog extends \Phalcon\Mvc\Model {
  4.     public function deleteImages($ident){
  5.         //не знаком с фреймом, может и через $this->find() можно
  6.         $images = Imagesarticles::find("ident = {$ident}");
  7.         foreach($images as $img){
  8.             @unlink('.'.$img->image);
  9.             @unlink('.'.str_replace('.','_thumb.',$img->image));
  10.             foreach(UploadHelper::$sizes as $item){
  11.                 @unlink('.'.str_replace('.','_thumb'.$item.'.',$img->image));
  12.             }
  13.             $img->delete();
  14.         }
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement