本文整理匯總了PHP中SugarFeed::pushFeed方法的典型用法代碼示例。如果您正苦於以下問題:PHP SugarFeed::pushFeed方法的具體用法?PHP SugarFeed::pushFeed怎麽用?PHP SugarFeed::pushFeed使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SugarFeed
的用法示例。
在下文中一共展示了SugarFeed::pushFeed方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testpushFeed
public function testpushFeed()
{
SugarFeed::pushFeed('some text', 'SugarFeed', 1, 1, 'Link', 'some url');
//retrieve newly created bean
$sugarFeed = new SugarFeed();
$result = $sugarFeed->retrieve_by_string_fields(array('related_id' => '1', 'related_module' => 'SugarFeed'));
//test for record ID to verify that record is saved
$this->assertTrue(isset($sugarFeed->id));
$this->assertEquals(36, strlen($sugarFeed->id));
//test fetchReplies method
$this->fetchReplies();
//mark the record as deleted
$sugarFeed->mark_deleted($sugarFeed->id);
}
示例2: pushUserFeedReply
function pushUserFeedReply()
{
if (!empty($_REQUEST['text']) && !empty($_REQUEST['parentFeed'])) {
$text = htmlspecialchars($_REQUEST['text']);
//allow for bold and italic user tags
$text = preg_replace('/&lt;(\\/*[bi])&gt;/i', '<$1>', $text);
SugarFeed::pushFeed($text, 'SugarFeed', $_REQUEST['parentFeed'], $GLOBALS['current_user']->id, '', '');
}
}