示例#1
0
 public static function getImages($id)
 {
     $pref = new DBPreferencesType();
     $catalogDir = $pref->getPreference(Constants::CATALOG_PATH)[DB::TABLE_PREFERENCES__VALUE];
     $goodsType = new DBGoodsType();
     $good = $goodsType->get($id);
     $goodCode = $good[DB::TABLE_GOODS__KEY_ITEM];
     $images = [];
     if (!is_null($goodCode)) {
         $images = FileUtils::getFilesByPrefixByDescription(FileUtils::buildPath($catalogDir, $goodCode), Constants::SMALL_IMAGE, "jpg");
         //$filesMedium = FileUtils::getFilesByPrefixByDescription(Constants::DEFAULT_ROOT_CATALOG_PATH.DIRECTORY_SEPARATOR.$goodCode.DIRECTORY_SEPARATOR, Constants::MEDIUM_IMAGE, "jpg");
     }
     return $images;
 }