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


PHP Type::getId方法代碼示例

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


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

示例1: formObject

 public function formObject()
 {
     $model = new Type($this->data->id);
     $this->data->forUpdate = $this->data->id != '';
     $this->data->object = $model->getData();
     $this->data->title = $this->data->forUpdate ? $model->getDescription() : _M("New Type");
     $this->data->save = "@fnbr20/admin/type/save/" . $model->getId() . '|formObject';
     $this->data->delete = "@fnbr20/admin/type/delete/" . $model->getId() . '|formObject';
     $this->render();
 }
開發者ID:elymatos,項目名稱:expressive_fnbr,代碼行數:10,代碼來源:TypeController.php

示例2: update

 public function update(Type $t)
 {
     $q = $this->_db->prepare('UPDATE Types SET libelle= :libelle WHERE id = :id');
     $q->bindValue(':id', $t->getId(), PDO::PARAM_INT);
     $q->bindValue(':libelle', $t->getLibelle(), PDO::PARAM_STR);
     $q->execute();
 }
開發者ID:abrantes01,項目名稱:tripping-octo-nemesis,代碼行數:7,代碼來源:TypeManager.php

示例3: flush

 /**
  * 
  * @param Type $type
  * @return int id of the Type inserted in base. False if it didn't work.
  */
 public static function flush($type)
 {
     $typeId = $type->getId();
     $typeName = $type->getTypeName();
     if ($typeId > 0) {
         $sql = 'UPDATE type t SET ' . 't.type_name = ?, ' . 'WHERE t.id_type = ?';
         $params = array('si', &$typeName, $typeId);
     } else {
         $sql = 'INSERT INTO type ' . '(type_name) ' . 'VALUES(?) ';
         $params = array('s' & $typeName);
     }
     $idInsert = BaseSingleton::insertOrEdit($sql, $params);
     if ($idInsert !== false && $typeId > 0) {
         $idInsert = $typeId;
     }
     return $idInsert;
 }
開發者ID:Eurymone,項目名稱:Student-Exam-Report-System,代碼行數:22,代碼來源:TypeDAL.php

示例4: updateType

 public function updateType(Type $type)
 {
     try {
         if ($type != null && $type->getId() == null || $type == -1) {
             return false;
         }
         if (!parent::getBdd()->inTransaction()) {
             parent::getBdd()->beginTransaction();
         }
         $query = "UPDATE TYPE SET label = :label WHERE id = :id";
         $request = parent::getBdd()->prepare($query);
         $request->bindParam(':id', $type->getId());
         $request->bindParam(':label', $type->getLabel());
         $request->execute();
         parent::getBdd()->commit();
         $request->closeCursor();
         return true;
     } catch (Exception $e) {
         error_log($e->getMessage());
     }
     return false;
 }
開發者ID:alex148,項目名稱:SmartMastore,代碼行數:22,代碼來源:TypeService.php

示例5: setType

 /**
  * Declares an association between this object and a Type object.
  *
  * @param      Type $v
  * @return     Customer The current object (for fluent API support)
  * @throws     PropelException
  */
 public function setType(Type $v = null)
 {
     if ($v === null) {
         $this->setTypeId(NULL);
     } else {
         $this->setTypeId($v->getId());
     }
     $this->aType = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the Type object, it will not be re-added.
     if ($v !== null) {
         $v->addCustomer($this);
     }
     return $this;
 }
開發者ID:rewrewby,項目名稱:propertyx,代碼行數:22,代碼來源:BaseCustomer.php

示例6: addInstanceToPool

 /**
  * 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      Type $value A Type object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(Type $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }
開發者ID:rewrewby,項目名稱:propertyx,代碼行數:22,代碼來源:BaseTypePeer.php

示例7: Type

 function test_find()
 {
     //Arrange
     $descript = "Event Keepsakes";
     $descript2 = "Antiques";
     $test_Type = new Type($descript);
     $test_Type->save();
     $test_Type2 = new Type($descript2);
     $test_Type2->save();
     //Act
     $result = Type::find($test_Type->getId());
     //Assert
     $this->assertEquals($test_Type, $result);
 }
開發者ID:jmalo34,項目名稱:Inventory_Collection,代碼行數:14,代碼來源:TypeTest.php


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