Exemplo n.º 1
0
 /**
  * 商品画像のパスを取得する
  *
  * @param $arrForm
  * @return string 指定された商品画像のパス
  */
 public function lfGetProductImage($arrForm)
 {
     $objQuery = Application::alias('eccube.query');
     $table = 'dtb_products';
     $col = $arrForm['image_key'];
     $product_id = $arrForm['product_id'];
     //指定されたカラムが存在する場合にのみ商品テーブルからファイル名を取得
     if (Application::alias('eccube.helper.db')->columnExists($table, $col, '', '', false)) {
         $product_image = $objQuery->get($col, $table, 'product_id = ?', array($product_id));
     } else {
         GcUtils::gfPrintLog('invalid access :resize_image.php image_key=' . $col);
         $product_image = '';
     }
     // ファイル名が正しく、ファイルが存在する場合だけ、$fileを設定
     $file = Utils::getSaveImagePath($product_image);
     return $file;
 }