當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Groups::setName方法代碼示例

本文整理匯總了PHP中Groups::setName方法的典型用法代碼示例。如果您正苦於以下問題:PHP Groups::setName方法的具體用法?PHP Groups::setName怎麽用?PHP Groups::setName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Groups的用法示例。


在下文中一共展示了Groups::setName方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setName

 public function setName($name)
 {
     $this->__load();
     return parent::setName($name);
 }
開發者ID:uxcriativo,項目名稱:FULLigniter,代碼行數:5,代碼來源:__CG__Groups.php

示例2: executeValidate

 public function executeValidate(sfWebRequest $request)
 {
     $id = $request->getParameter('id');
     if ($id) {
         $this->forward404Unless($reservation = Doctrine::getTable('Reservation')->find(array($id)), sprintf('Object reservation does not exist (%s).', $id));
     }
     $d = array();
     $d['designation'] = $request->getParameter('designation');
     $d['description'] = $request->getParameter('description');
     $d['type'] = $request->getParameter('type');
     if ($d['type'] == "") {
         $d['type'] = "group";
     }
     $d['public_designation'] = '';
     $d['public_description'] = '';
     $d['public'] = $request->getParameter('public') ? 1 : 0;
     if ($d['public']) {
         $d['public_designation'] = $request->getParameter('public_designation');
         $d['public_description'] = $request->getParameter('public_description');
     }
     switch ($d['type']) {
         case 'group':
             $d['type_id'] = $request->getParameter('type_group');
             break;
         case 'event':
             $d['type_id'] = $request->getParameter('type_event');
             break;
         default:
             $d['type_id'] = $request->getParameter('type_user');
             break;
     }
     // create group if new reservation
     if ($d['type_id'] == "" && $d['type'] == "group") {
         $g = new Groups();
         $g->setName($d['designation']);
         $g->save();
         $d['type_id'] = $g->getId();
     }
     if ($id) {
         $this->update('Reservation', $d, $id);
     } else {
         //$this->insert('Reservation', $d);
         $r = new Reservation();
         $r->setDesignation($d['designation']);
         $r->setDescription($d['description']);
         $r->setType($d['type']);
         $r->setTypeId($d['type_id']);
         $r->setPublic($d['public']);
         $r->setPublicDesignation($d['public_designation']);
         $r->setPublicDescription($d['public_description']);
         $r->save();
         $request->setParameter('id', $r->getId());
     }
     $this->startdate = $request->getParameter('startdate');
     $this->stopdate = $request->getParameter('stopdate');
     if (!$request->getParameter('ajax')) {
         $this->redirect('reservation/list');
     } else {
         if ($id) {
             $this->executeAjaxDetailedReservation($request);
         } else {
             $this->executeAjaxAddPeriod($request);
         }
     }
 }
開發者ID:xmasclaux,項目名稱:OpenGenepi,代碼行數:65,代碼來源:actions.class.php


注:本文中的Groups::setName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。