/** * Exclude object from result * * @param ForumPost $forumPost Object to remove from the list of results * * @return ForumPostQuery The current query, for fluid interface */ public function prune($forumPost = null) { if ($forumPost) { $this->addUsingAlias(ForumPostPeer::POST_ID, $forumPost->getPostId(), Criteria::NOT_EQUAL); } return $this; }
/** * 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 ForumPost $value A ForumPost object. * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). */ public static function addInstanceToPool(ForumPost $obj, $key = null) { if (Propel::isInstancePoolingEnabled()) { if ($key === null) { $key = (string) $obj->getPostId(); } // if key === null self::$instances[$key] = $obj; } }
public function threadSave() { //region Set_thread_main_Info $postInfo['prefixid'] = $this->_vbulletin->options['yrms_vietsubmanga_prefixid_type' . $this->_type]; if (!empty($this->_fansubName)) { $postInfo['title'] .= "[{$this->_fansubName}] "; } if ($this->_type == 3 && !empty($this->_originalComposition)) { $postInfo['title'] .= "[{$this->_originalComposition}] "; } $postInfo['title'] .= $this->_mangaTitle; $postInfo['allowsmilie'] = 1; $postInfo['visible'] = 1; $postInfo['parseurl'] = 1; //endregion //region Manga_info if ($this->_numberOfChapter == 0) { $numberOfChapter = '??'; } else { $numberOfChapter = $this->_numberOfChapter; } $mangaInfo = construct_phrase($this->_vbphrase['yrms_postformat_highlightvalue'], $this->_vbphrase['yrms_mangatitle'], $this->_mangaTitle) . "\n"; if ($this->_otherTitle) { $mangaInfo .= construct_phrase($this->_vbphrase['yrms_postformat_highlightvalue'], $this->_vbphrase['yrms_othertitle'], $this->_otherTitle) . "\n"; } $mangaInfo .= construct_phrase($this->_vbphrase['yrms_postformat_highlightvalue'], $this->_vbphrase['yrms_author'], $this->_author) . "\n" . construct_phrase($this->_vbphrase['yrms_postformat_highlightvalue'], $this->_vbphrase['yrms_genre'], $this->_genre) . "\n" . construct_phrase($this->_vbphrase['yrms_postformat_highlightvalue'], $this->_vbphrase['yrms_numberofchapter'], $numberOfChapter) . "\n" . construct_phrase($this->_vbphrase['yrms_postformat_highlightvalue'], $this->_vbphrase['yrms_projectstatus'], $this->_vbphrase["yrms_projectstatus{$this->_status}"]) . "\n"; $fansubInfo = ''; if (!empty($this->_fansubMember['translator'])) { $fansubInfo .= construct_phrase($this->_vbphrase['yrms_postformat_highlightvalue'], $this->_vbphrase['yrms_translator'], get_username_massively($this->_fansubMember['translator'])) . "\n"; } if (!empty($this->_fansubMember['proofreader'])) { $fansubInfo .= construct_phrase($this->_vbphrase['yrms_postformat_highlightvalue'], $this->_vbphrase['yrms_proofreader'], get_username_massively($this->_fansubMember['proofreader'])) . "\n"; } if (!empty($this->_fansubMember['editor'])) { $fansubInfo .= construct_phrase($this->_vbphrase['yrms_postformat_highlightvalue'], $this->_vbphrase['yrms_mangaeditor'], get_username_massively($this->_fansubMember['editor'])) . "\n"; } if (!empty($this->_fansubMember['qualitychecker'])) { $fansubInfo .= construct_phrase($this->_vbphrase['yrms_postformat_highlightvalue'], $this->_vbphrase['yrms_qualitychecker'], get_username_massively($this->_fansubMember['qualitychecker'])) . "\n"; } if (!empty($this->_fansubMember['uploader'])) { $fansubInfo .= construct_phrase($this->_vbphrase['yrms_postformat_highlightvalue'], $this->_vbphrase['yrms_uploader'], get_username_massively($this->_fansubMember['uploader'])) . "\n"; } $fansubInfo .= construct_phrase($this->_vbphrase['yrms_postformat_highlightvalue'], $this->_vbphrase['yrms_fansub_website'], $this->_fansubSite); //endregion $linkformat = false; if ($linkformat === false) { $linkformat = $this->_vbphrase['yrms_tobeupdated']; } //build post $postInfo['pagetext'] = construct_phrase($this->_vbphrase['yrms_postformat_vietsubmanga'], $this->_vbulletin->options['yrms_main_illustrationwidth'], $this->_illustration, $mangaInfo, $this->_summary, $this->_fansubName, $fansubInfo, $this->_fansubNote, $linkformat); $thread = new ForumPost('thread'); $thread->setForumId($this->_forumId)->setThreadId($this->_threadId)->setPostInfo($postInfo)->setYrmspost(1)->setPosterId($this->_posterId)->save(); $this->_threadId = $thread->getThreadId(); $this->_postId = $thread->getPostId(); }