public static function createNew($name, $content, $scope = null, $options = array()) { $user_id = framework\Context::getUser() instanceof User ? framework\Context::getUser()->getID() : 0; $article = new Article(); $article->setName($name); $article->setContent($content); if (!isset($options['noauthor'])) { $article->setAuthor($user_id); } else { $article->setAuthor(0); } if ($scope !== null) { $article->setScope($scope); } $article->doSave($options); return $article->getID(); }