本文整理汇总了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>
示例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();
}