当前位置: 首页>>代码示例>>PHP>>正文


PHP Recipe::delete方法代码示例

本文整理汇总了PHP中Recipe::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Recipe::delete方法的具体用法?PHP Recipe::delete怎么用?PHP Recipe::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Recipe的用法示例。


在下文中一共展示了Recipe::delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: die

            $rc = $DB_LINK->Execute($sql);
            // If the recipe is owned by someone else then do not allow editing
            if ($rc->fields['recipe_user'] != "" && $rc->fields['recipe_user'] != $SMObj->getUserID()) {
                die($LangUI->_('You do not have sufficient privileges to delete this recipe!'));
            }
        }
        /* Go ahead and do the delete */
        // clean up the old picture if we are suppose to
        if ($g_rb_database_type == "postgres") {
            $sql = "SELECT recipe_picture FROM {$db_table_recipes} WHERE recipe_id=" . $DB_LINK->addq($recipe_id, get_magic_quotes_gpc());
            $rc = $DB_LINK->Execute($sql);
            if (trim($rc->fields['recipe_picture']) != "") {
                $rc = $DB_LINK->BlobDelete($rc->fields['recipe_picture']);
                DBUtils::checkResult($rc, $LangUI->_('Picture successfully deleted'), NULL, $sql);
            }
        }
        // In Postgres everything will be cleaned up with one delete
        $RecipeObj = new Recipe($recipe_id);
        $RecipeObj->delete();
    }
    $iterator++;
    $item_id = "recipe_id_" . $iterator;
    $item_delete = "recipe_selected_" . $iterator;
}
?>
<I><?php 
echo $LangUI->_('Recipe Deleted');
?>
</I>
<P>
开发者ID:pjflameboy,项目名称:phprecipebook,代码行数:30,代码来源:delete.php

示例2: delete

 function delete($id = false)
 {
     #esli ID ne peredaetsa to perehod na spisok
     if (!$id) {
         $this->show();
         return;
     }
     $recipe = new Recipe();
     $recipe->get_full_info($id);
     if ($recipe->id) {
         #
         foreach ($recipe->recipe_step as $recipe_step) {
             $this->upload_image_lib->delete_img('recipe', $recipe_step->image);
         }
         $recipe->recipe_step->delete_all();
         #
         foreach ($recipe->recipe_image as $recipe_image) {
             $this->upload_image_lib->delete_img('recipe', $recipe->id . '_' . $recipe_image->id);
         }
         $recipe->recipe_image->delete_all();
         #
         $recipe->delete();
     }
     $this->show();
 }
开发者ID:usaphp,项目名称:listafe,代码行数:25,代码来源:recipes.php


注:本文中的Recipe::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。