function deleteUserFeed()
 {
     if (!empty($_REQUEST['record'])) {
         $feed = new SugarFeed();
         $feed->retrieve($_REQUEST['record']);
         if (is_admin($GLOBALS['current_user']) || $feed->created_by == $GLOBALS['current_user']->id) {
             $feed->mark_deleted($_REQUEST['record']);
         }
     }
 }
Ejemplo n.º 2
0
 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);
 }