Exemplo n.º 1
0
 /**
  * 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;
     }
 }
Exemplo n.º 2
0
     //TODO inputs validation
     // Manage ressources
     if ($toolIntro->save()) {
         $currentLocator = ResourceLinker::$Navigator->getCurrentLocator(array('id' => (int) $toolIntro->getId()));
         $resourceList = isset($_REQUEST['resourceList']) ? $_REQUEST['resourceList'] : array();
         ResourceLinker::updateLinkList($currentLocator, $resourceList);
         $dialogBox->success(get_lang('Introduction added'));
         // Notify that the introsection has been created
         $claroline->notifier->notifyCourseEvent('introsection_created', claro_get_current_course_id(), claro_get_current_tool_id(), $toolIntro->getId(), claro_get_current_group_id(), '0');
     }
 } elseif ($cmd == 'exEd') {
     $toolIntro = new ToolIntro($id);
     $toolIntro->handleForm();
     //TODO inputs validation
     if ($toolIntro->save()) {
         $currentLocator = ResourceLinker::$Navigator->getCurrentLocator(array('id' => (int) $toolIntro->getId()));
         $resourceList = isset($_REQUEST['resourceList']) ? $_REQUEST['resourceList'] : array();
         ResourceLinker::updateLinkList($currentLocator, $resourceList);
         $dialogBox->success(get_lang('Introduction modified'));
         // Notify that the introsection has been modified
         $claroline->notifier->notifyCourseEvent('introsection_modified', claro_get_current_course_id(), claro_get_current_tool_id(), $toolIntro->getId(), claro_get_current_group_id(), '0');
     }
 } elseif ($cmd == 'exDel') {
     $toolIntro = new ToolIntro($id);
     if ($toolIntro->delete()) {
         $dialogBox->success(get_lang('Introduction deleted'));
         //TODO linker_delete_resource('CLINTRO_');
     }
 } elseif ($cmd == 'exMvUp') {
     $toolIntro = new ToolIntro($id);
     if ($toolIntro->load()) {
Exemplo n.º 3
0
 /**
  * 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;
 }