/** * 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 ToolIntro $value A ToolIntro object. * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). */ public static function addInstanceToPool(ToolIntro $obj, $key = null) { if (Propel::isInstancePoolingEnabled()) { if ($key === null) { $key = (string) $obj->getId(); } // if key === null self::$instances[$key] = $obj; } }
$dialogBox->error(get_lang('This introduction\'s visibility can\'t be modified')); } } } } // Display $cmdList = array(); if (claro_is_allowed_to_edit()) { $cmdList[] = array('img' => 'headline_new', 'name' => get_lang('New headline'), 'url' => claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=rqAdd'))); } $cmdList[] = array('img' => 'coursehome', 'name' => get_lang('Back to course homepage'), 'url' => claro_htmlspecialchars(Url::Contextualize(get_path('rootWeb') . 'claroline/course/index.php?cid=' . claro_get_current_course_id()))); $toolIntroIterator = new ToolIntroductionIterator(claro_get_current_course_id()); $toolIntroductionList = ''; if (count($toolIntroIterator) > 0) { foreach ($toolIntroIterator as $toolIntro) { $toolIntroductionList .= $toolIntro->render(); } } else { // If there's no item, display the form to add one $toolIntro = new ToolIntro(); $dialogBox->info(get_lang('There\'s no headline for this course right now. Use the form below to add a new one.')); $toolIntroForm = empty($toolIntroForm) ? $toolIntro->renderForm() : $toolIntroForm; } Claroline::getDisplay()->body->appendContent(claro_html_tool_title(get_lang('Headlines'), null, $cmdList)); Claroline::getDisplay()->body->appendContent($dialogBox->render()); $output = ''; $output .= $toolIntroForm . $toolIntroductionList; // Append output Claroline::getDisplay()->body->appendContent($output); // Render output echo $claroline->display->render();
/** * Exclude object from result * * @param ToolIntro $toolIntro Object to remove from the list of results * * @return ToolIntroQuery The current query, for fluid interface */ public function prune($toolIntro = null) { if ($toolIntro) { $this->addUsingAlias(ToolIntroPeer::ID, $toolIntro->getId(), Criteria::NOT_EQUAL); } return $this; }