} elseif ($blogService->isBlogger($g_user)) { // test if using authors from blog if (!$blogService->isBlogAuthor($authorObj, $blogInfo)) { continue; } } // Sets the author type selected $author_type = $f_article_author_type[$i]; $authorObj->setType($author_type); // Links the author to the article if ($authorObj->getId() != 0) { $articleAuthorObj = new ArticleAuthor($articleObj->getArticleNumber(), $articleObj->getLanguageId(), $authorObj->getId(), $author_type, $i + 1); } if (isset($articleAuthorObj) && !$articleAuthorObj->exists()) { $articleAuthorObj->create(); $dispatcher->dispatch("user.set_points", new \Newscoop\EventDispatcher\Events\GenericEvent($this, array('authorId' => $articleAuthorObj->getAuthorId()))); } $i++; } } // Update the article. $articleObj->setTitle($f_article_title); $articleObj->setIsIndexed(false); if (!empty($f_comment_status)) { if ($f_comment_status == "enabled" || $f_comment_status == "locked") { $commentsEnabled = true; } else { $commentsEnabled = false; } // If status has changed, then you need to show/hide all the comments // as appropriate.
/** * Adds an object to the instance pool. * * Propel keeps cached copies of objects in an instance pool when they are retrieved * from the database. In some cases -- especially when you override doSelect*() * methods in your stub classes -- you may need to explicitly add objects * to the cache in order to ensure that the same objects are always returned by doSelect*() * and retrieveByPK*() calls. * * @param ArticleAuthor $value A ArticleAuthor object. * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). */ public static function addInstanceToPool(ArticleAuthor $obj, $key = null) { if (Propel::isInstancePoolingEnabled()) { if ($key === null) { $key = serialize(array((string) $obj->getArticleId(), (string) $obj->getAuthorId())); } // if key === null self::$instances[$key] = $obj; } }