当前位置: 首页>>代码示例>>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;未经允许,请勿转载。