Пример #1
1
 public function delete()
 {
     $appHouseAds = AppHouseAdUtil::getAppHouseAdsByCid($this->id);
     foreach ($appHouseAds as $appHouseAd) {
         $appHouseAd->delete();
     }
     if (!empty($this->imageLink)) {
         if (extension_loaded('curl') && !@dl(PHP_SHLIB_SUFFIX == 'so' ? 'curl.so' : 'php_curl.dll')) {
             $s3 = new S3(HouseAd::$HOUSEAD_AWS_KEY, HouseAd::$HOUSEAD_AWS_SECRET);
             $s3->deleteObject(HouseAd::$HOUSEAD_BUCKET, basename($this->imageLink));
         }
     }
     parent::delete();
     CacheUtil::invalidateCustom($this->id);
 }