Skip to content

Instantly share code, notes, and snippets.

@kolyadin
Created November 28, 2013 14:39
Show Gist options
  • Save kolyadin/7692918 to your computer and use it in GitHub Desktop.
Save kolyadin/7692918 to your computer and use it in GitHub Desktop.
public static function incrementViews($newsId){
self::checkDataMap();
/** @var $post \popcorn\model\posts\NewsPost */
$post = self::$dataMap->findById($newsId);
$post->setViews($post->getViews()+1);
self::$dataMap->save($post);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment