addSelectColumn(BlogI18nPeer::ID); $c->add(BlogI18nPeer::URL, $url); $c->setLimit(1); $rs = BlogI18nPeer::doSelectRS($c); if ($rs->next()) { $row = $rs->getRow(); $c = new Criteria(); $c->add(self::ID, $row[0]); $c->setLimit(1); $tmp = self::doSelectWithI18n($c); self::$urlPool[$url] = $tmp ? $tmp[0] : null; } } return @self::$urlPool[$url]; } public static function doCountWithI18n(Criteria $c, $con = null) { $c = clone $c; $c->addJoin(BlogI18nPeer::ID, BlogPeer::ID); $c->add(BlogI18nPeer::CULTURE, stLanguage::getHydrateCulture()); return self::doCount($c, $con); } public static function doSelectWithI18n(Criteria $c, $culture = null, $con = null) { if ($culture === null) { $culture = stLanguage::getHydrateCulture(); } return parent::doSelectWithI18n($c, $culture, $con); } public static function clearCache() { $cache = new stFunctionCache('stBlogPlugin'); $cache->removeAll(); } public static function doSelectBlogForTokenInput(Blog $blog) { return json_decode($blog->getRecommend()); } public static function doSelectTokens(Criteria $c) { sfLoader::loadHelpers(array('Helper')); $c = clone $c; $c->addSelectColumn(self::ID); $c->addSelectColumn(self::OPT_NAME); $rs = self::doSelectRs($c); $tokens = array(); while ($rs->next()) { list($id, $name) = $rs->getRow(); $tokens[] = array('id' => $id, 'name' => $name); } return $tokens; } }