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


PHP Article::delete方法代码示例

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


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

示例1: deleteArticle

 public static function deleteArticle($id)
 {
     if (isset($id)) {
         $article = new Article($id);
         $article->delete();
     }
 }
开发者ID:AJIACTOP,项目名称:MVC-Framework,代码行数:7,代码来源:ControllerArticle.php

示例2: delete

 function delete($id = FALSE)
 {
     if ($id) {
         $article = new Article($id);
         $article->delete();
         set_notify('success', lang('delete_data_complete'));
     }
     redirect('articles/admin/articles');
 }
开发者ID:unisexx,项目名称:thaigcd2015,代码行数:9,代码来源:articles.php

示例3: delete

 public function delete($f3, $param)
 {
     $table = $param['table'];
     $db_table_name = MyConst::$tables[$table];
     if ($this->f3->exists('PARAMS.id')) {
         $article = new Article($this->db, MyConst::$tables[$table], MyConst::$cols[$table]);
         $article->delete($this->f3->get('PARAMS.id'));
     }
     $this->f3->reroute('/list/' . $param['table']);
     //	    echo Template::instance()->render('layout.htm');
 }
开发者ID:srccn,项目名称:hy,代码行数:11,代码来源:ArticleController.php

示例4: testAdd

 public function testAdd()
 {
     // Build a request like it looks in Ext JS.
     $rawPostData = json_encode(array(array('action' => 'Article', 'method' => 'create', 'tid' => 1, 'type' => 'rpc', 'data' => array(array('data' => array('title' => 'Hello World', 'body' => 'foobar', 'published' => false, 'user_id' => 1))))));
     $dispatcher = new BanchaDispatcher();
     $responses = json_decode($dispatcher->dispatch(new BanchaRequestCollection($rawPostData), array('return' => true)));
     $this->assertNotNull($responses[0]->result->data->id);
     $this->assertEquals('Hello World', $responses[0]->result->data->title);
     $this->assertEquals(false, $responses[0]->result->data->published);
     $this->assertEquals(1, $responses[0]->result->data->user_id);
     // general response checks (check dispatcher, collections and transformers)
     $this->assertEquals('Article', $responses[0]->action);
     $this->assertEquals('create', $responses[0]->method);
     $this->assertEquals('rpc', $responses[0]->type);
     $this->assertEquals(1, $responses[0]->tid);
     $this->assertEquals(1, count($responses));
     // Clean up operations: delete article
     $article = new Article();
     $article->id = $responses[0]->result->data->id;
     $article->delete();
 }
开发者ID:rolandschuetz,项目名称:Bancha,代码行数:21,代码来源:BanchaCrudTest.php

示例5: Article

	function test_article() {
		$article = new Article(9000001,9000002,9000003,9000004);

		// Test create
		$article->create("Unit Test Long Name",
						 "Unit Test Short Name",
						 "fastnews");
		$this->assertTrue($article->exists());

		// Test SET functions
		$article->setTitle("Unit Test New Title");
		$article->setCreatorId(9000005);
		$article->setOnFrontPage(true);
		$article->setOnSection(true);
		$article->setWorkflowStatus('Y');
		$article->setKeywords("Unit, Test");
		$article->setIsIndexed(true);

		// Test GET functions
		$articleCopy = new Article(9000001, 9000002, 9000003, 9000004, $article->getArticleId());
		$this->assertEquals(9000001, $articleCopy->getPublicationId());
		$this->assertEquals(9000002, $articleCopy->getIssueNumber());
		$this->assertEquals(9000003, $articleCopy->getSectionNumber());
		$this->assertEquals(9000004, $articleCopy->getLanguageId());
		$this->assertEquals(9000005, $articleCopy->getCreatorId());
		$this->assertEquals("Unit Test New Title", $articleCopy->getTitle());
		$this->assertEquals(true, $articleCopy->onFrontPage());
		$this->assertEquals(true, $articleCopy->onSection());
		$this->assertEquals('Y', $articleCopy->getWorkflowStatus());
		$this->assertEquals("Unit, Test", $articleCopy->getKeywords());
		$this->assertEquals(true, $articleCopy->isIndexed());

		// Test DELETE functions
		$article->delete();
		$this->assertFalse($article->exists());
	}
开发者ID:nistormihai,项目名称:Newscoop,代码行数:36,代码来源:CampsiteTests.php

示例6: delete

 /**
  * Delete the file, or an earlier version of it
  */
 public function delete()
 {
     $file = $this->mPage->getFile();
     if (!$file->exists() || !$file->isLocal() || $file->getRedirected()) {
         // Standard article deletion
         parent::delete();
         return;
     }
     $deleter = new FileDeleteForm($file);
     $deleter->execute();
 }
开发者ID:Tarendai,项目名称:spring-website,代码行数:14,代码来源:ImagePage.php

示例7: buildMessage

    $returnJson['messages'][] = buildMessage('notAffected', $notAffectedNo, $errorMessage);
    return json_encode($returnJson);
}
switch ($f_action) {
    case 'delete':
        if (!$g_user->hasPermission('DeleteArticle')) {
            $success = false;
            $data->error = $translator->trans('You do not have the right to delete articles.', array(), 'library');
            break;
        }
        $affectedArticles = 0;
        $notAffectedArticles = 0;
        foreach ($articleCodes as $articleCode) {
            $article = new Article($articleCode['language_id'], $articleCode['article_id']);
            $creatorId = $article->getCreatorId();
            if ($article->delete()) {
                \Zend_Registry::get('container')->getService('dispatcher')->dispatch('user.set_points', new \Newscoop\EventDispatcher\Events\GenericEvent(null, array('user' => $creatorId)));
                $success = true;
                $affectedArticles += 1;
            } else {
                $notAffectedArticles += 1;
            }
        }
        $message = $translator->trans("\$1 articles have been removed", array('$1' => $affectedArticles), 'library');
        $errorMessage = $translator->trans("\$1 articles have not been removed", array('$1' => $notAffectedArticles), 'library');
        break;
    case "workflow_publish":
        if (!$g_user->hasPermission('Publish')) {
            $success = false;
            $data->error = $translator->trans('You do not have the right to change this article status. Once submitted an article can only be changed by authorized users.', array(), 'library');
            break;
开发者ID:sourcefabric,项目名称:newscoop,代码行数:31,代码来源:do_action.php

示例8: delete

 /**
  * Delete the file, or an earlier version of it
  */
 public function delete()
 {
     global $wgUploadMaintenance;
     if ($wgUploadMaintenance && $this->mTitle && $this->mTitle->getNamespace() == NS_FILE) {
         global $wgOut;
         $wgOut->wrapWikiMsg("<div class='error'>\n\$1\n</div>\n", array('filedelete-maintenance'));
         return;
     }
     $this->loadFile();
     if (!$this->img->exists() || !$this->img->isLocal() || $this->img->getRedirected()) {
         // Standard article deletion
         parent::delete();
         return;
     }
     $deleter = new FileDeleteForm($this->img);
     $deleter->execute();
 }
开发者ID:GodelDesign,项目名称:Godel,代码行数:20,代码来源:ImagePage.php

示例9: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy(Request $request, Article $article)
 {
     $article->delete();
     if ($request->ajax() || $request->wantsJson()) {
         return new JsonResponse($article);
     }
     return redirect('article');
 }
开发者ID:pgcampana,项目名称:laravel-users-example,代码行数:14,代码来源:ArticlesController.php

示例10: getGS

             $articleObj->setWorkflowStatus('S');
         }
     }
     camp_html_add_msg(getGS("Article status set to '\$1'", getGS("Submitted")), "ok");
     break;
 case "workflow_publish":
     foreach ($articleCodes as $articleCode) {
         $articleObj = new Article($articleCode['language_id'], $articleCode['article_id']);
         $articleObj->setWorkflowStatus('Y');
     }
     camp_html_add_msg(getGS("Article status set to '\$1'", getGS("Published")), "ok");
     break;
 case "delete":
     foreach ($articleCodes as $articleCode) {
         $articleObj = new Article($articleCode['language_id'], $articleCode['article_id']);
         $articleObj->delete();
     }
     if ($f_article_offset > 15 && count($articleCodes) + $f_article_offset == $f_total_articles) {
         $f_article_offset -= $ArticlesPerPage;
     }
     camp_html_add_msg(getGS("Article(s) deleted."), "ok");
     break;
 case "toggle_front_page":
     foreach ($articleCodes as $articleCode) {
         $articleObj = new Article($articleCode['language_id'], $articleCode['article_id']);
         if ($articleObj->userCanModify($g_user)) {
             $articleObj->setOnFrontPage(!$articleObj->onFrontPage());
         }
     }
     camp_html_add_msg(getGS("\$1 toggled.", "&quot;" . getGS("On Front Page") . "&quot;"), "ok");
     break;
开发者ID:nidzix,项目名称:Newscoop,代码行数:31,代码来源:do_article_list_action.php

示例11: delete

 function delete()
 {
     global $wgOut, $wgRequest, $wgUser;
     if (!$wgRequest->wasPosted()) {
         $wgOut->addHTML(wfMsg('mv_stream_delete_warrning', MV_Index::countMVDInRange($this->mvTitle->getStreamId())));
     }
     //update text button to delete stream rather than delete stream
     parent::delete();
 }
开发者ID:BenoitTalbot,项目名称:bungeni-portal,代码行数:9,代码来源:MV_StreamPage.php

示例12: events

$issuePublishEvent->dumpToHtml();

echo "Executing pending events:<br>";
$events = IssuePublish::GetPendingActions();
foreach ($events as $event) {
    $event->doAction();
    $event->dumpToHtml();
}

// Check if issues are published
echo "Is the issue published?<br>";
$issue->fetch();
$issue->dumpToHtml();

// Are the articles published?
echo "Are the articles published?<br>";
$article1->fetch();
$article1->dumpToHtml();
$article2->fetch();
$article2->dumpToHtml();

echo "Number of remaining events (should be zero): ".count(IssuePublish::GetPendingActions())."<br>";

echo "Deleting objects.<br>";
$issue->delete();
$article1->delete();
$article2->delete();
$issuePublishEvent->delete();

echo "done.<br>";
?>
开发者ID:nistormihai,项目名称:Newscoop,代码行数:31,代码来源:test_autopublish.php

示例13: Article

<?php

$delete = new Article($DB);
//Die geholte imageID aus dem img via jQuery
$id = htmlspecialchars($_POST['catchedID']);
//$id als Parameter übergeben
$q_result = $delete->delete($id);
开发者ID:TimoGoltz,项目名称:IHK-Abschluss,代码行数:7,代码来源:delete.php

示例14: testResetOfExistsOnCreate

 /**
  * ensure that exists() does not persist between method calls reset on create
  *
  * @return void
  */
 public function testResetOfExistsOnCreate()
 {
     $this->loadFixtures('Article');
     $Article = new Article();
     $Article->id = 1;
     $Article->saveField('title', 'Reset me');
     $Article->delete();
     $Article->id = 1;
     $this->assertFalse($Article->exists());
     $Article->create();
     $this->assertFalse($Article->exists());
     $Article->id = 2;
     $Article->saveField('title', 'Staying alive');
     $result = $Article->read(null, 2);
     $this->assertEquals('Staying alive', $result['Article']['title']);
 }
开发者ID:agashish,项目名称:test_new,代码行数:21,代码来源:ModelIntegrationTest.php

示例15: delete

 /**
  * Delete the file, or an earlier version of it
  */
 public function delete()
 {
     if (!$this->img->exists() || !$this->img->isLocal()) {
         // Standard article deletion
         Article::delete();
         return;
     }
     $deleter = new FileDeleteForm($this->img);
     $deleter->execute();
 }
开发者ID:ErdemA,项目名称:wikihow,代码行数:13,代码来源:ImagePage.php


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