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


PHP Type::getDescription方法代碼示例

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


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

示例1: store

 /**
  * @param Type $type
  *
  * @return string
  * @throws exceptions\DBDuplicateEntryException
  * @throws exceptions\DBForeignKeyException
  */
 public function store(Type $type)
 {
     $query = 'INSERT INTO types (name, description) VALUES (:name, :description);';
     $this->db->prepare($query);
     $this->db->bindValue(':name', $type->getName());
     $this->db->bindValue(':description', $type->getDescription());
     $this->db->execute();
     return $this->db->lastInsertId();
 }
開發者ID:arkuuu,項目名稱:publin,代碼行數:16,代碼來源:TypeModel.php

示例2: 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

示例3: SelectQuery

 /**
  * Get the key of the type.
  * 
  * @param object Type $type
  * @return integer
  * @access private
  * @since 3/9/05
  */
 function _getTypeKey(Type $type)
 {
     $dbc = Services::getService("DatabaseManager");
     // Check if the type exists and return its key if found.
     $query = new SelectQuery();
     $query->addTable($this->_typeTable);
     $query->addColumn('id');
     $query->addWhere("domain='" . addslashes($type->getDomain()) . "'");
     $query->addWhere("authority='" . addslashes($type->getAuthority()) . "'", _AND);
     $query->addWhere("keyword='" . addslashes($type->getKeyword()) . "'", _AND);
     $result = $dbc->query($query, $this->_dbId);
     if ($result->getNumberOfRows() == 1) {
         return $result->field('id');
     } else {
         $result->free();
         $query = new InsertQuery();
         $query->setTable($this->_typeTable);
         $query->setAutoIncrementColumn("id", $this->_typeTable . "_id_seq");
         $query->setColumns(array('domain', 'authority', 'keyword', 'description'));
         $query->setValues(array("'" . addslashes($type->getDomain()) . "'", "'" . addslashes($type->getAuthority()) . "'", "'" . addslashes($type->getKeyword()) . "'", "'" . addslashes($type->getDescription()) . "'"));
         $result = $dbc->query($query, $this->_dbId);
         return $result->getLastAutoIncrementValue();
     }
 }
開發者ID:adamfranco,項目名稱:harmoni,代碼行數:32,代碼來源:AgentTokenMappingManager.class.php

示例4: createRootNode

 /**
  * Attempts to create the specified node as root node in the database.
  * @access public
  * @param object nodeId The id of the node.
  * @param object type The type of the node.
  * @param string displayName The display name of the node.
  * @param string description The description of the node.
  * @return void
  **/
 function createRootNode(Id $nodeId, Type $type, $displayName, $description)
 {
     // ** parameter validation
     $stringRule = StringValidatorRule::getRule();
     ArgumentValidator::validate($displayName, $stringRule, true);
     ArgumentValidator::validate($description, $stringRule, true);
     // ** end of parameter validation
     // check that the node does not exist in the cache
     $idValue = $nodeId->getIdString();
     if ($this->_isCached($idValue)) {
         // The node has already been cached!
         throw new OperationFailedException("Node, '{$idValue}' is already cached.");
     }
     // attempt to insert the node now
     $dbHandler = Services::getService("DatabaseManager");
     // 1. Insert the type
     $domain = $type->getDomain();
     $authority = $type->getAuthority();
     $keyword = $type->getKeyword();
     $typeDescription = $type->getDescription();
     // check whether the type is already in the DB, if not insert it
     if (isset($this->harmoni_db)) {
         if (!isset($this->createRootNode_selectType_stmt)) {
             $query = $this->harmoni_db->select();
             $query->addTable("az2_node_type");
             $query->addColumn("id");
             $query->addWhereRawEqual("domain", '?');
             $query->addWhereRawEqual("authority", '?');
             $query->addWhereRawEqual("keyword", '?');
             $this->createRootNode_selectType_stmt = $query->prepare();
         }
         $this->createRootNode_selectType_stmt->bindValue(1, $domain);
         $this->createRootNode_selectType_stmt->bindValue(2, $authority);
         $this->createRootNode_selectType_stmt->bindValue(3, $keyword);
         $this->createRootNode_selectType_stmt->execute();
         $queryResult = $this->createRootNode_selectType_stmt->getResult();
     } else {
         $query = new SelectQuery();
         $query->addTable("az2_node_type");
         $query->addColumn("id");
         $query->addWhereEqual("domain", $domain);
         $query->addWhereEqual("authority", $authority);
         $query->addWhereEqual("keyword", $keyword);
         $queryResult = $dbHandler->query($query, $this->_dbIndex);
     }
     if ($queryResult->hasNext()) {
         // if the type is already in the database
         $typeIdValue = $queryResult->field("id");
         // get the id
         $queryResult->free();
     } else {
         // if not, insert it
         $queryResult->free();
         if (isset($this->harmoni_db)) {
             if (!isset($this->createRootNode_insertType_stmt)) {
                 $query = $this->harmoni_db->insert();
                 $query->setTable("az2_node_type");
                 // 					$query->setAutoIncrementColumn("id", "az2_node_type_id_seq");
                 $query->addRawValue("domain", '?');
                 $query->addRawValue("authority", '?');
                 $query->addRawValue("keyword", '?');
                 $query->addRawValue("description", '?');
                 $this->createRootNode_insertType_stmt = $query->prepare();
             }
             $this->createRootNode_insertType_stmt->bindValue(1, $domain);
             $this->createRootNode_insertType_stmt->bindValue(2, $authority);
             $this->createRootNode_insertType_stmt->bindValue(3, $keyword);
             $this->createRootNode_insertType_stmt->bindValue(4, $typeDescription);
             $this->createRootNode_insertType_stmt->execute();
             $queryResult = $this->createRootNode_insertType_stmt->getResult();
         } else {
             $query = new InsertQuery();
             $query->setTable("az2_node_type");
             $query->setAutoIncrementColumn("id", "az2_node_type_id_seq");
             $query->addValue("domain", $domain);
             $query->addValue("authority", $authority);
             $query->addValue("keyword", $keyword);
             $query->addValue("description", $typeDescription);
             $queryResult = $dbHandler->query($query, $this->_dbIndex);
         }
         $typeIdValue = $queryResult->getLastAutoIncrementValue();
     }
     // 2. Now that we know the id of the type, insert the node itself
     if (isset($this->harmoni_db)) {
         if (!isset($this->createRootNode_insertNode_stmt)) {
             $query = $this->harmoni_db->insert();
             $query->setTable("az2_node");
             $query->addRawValue("id", '?');
             $query->addRawValue("display_name", '?');
             $query->addRawValue("description", '?');
             $query->addRawValue("fk_hierarchy", '?');
//.........這裏部分代碼省略.........
開發者ID:adamfranco,項目名稱:harmoni,代碼行數:101,代碼來源:HierarchyCache.class.php

示例5: array

 /**
  * Answer the database id for the type passed.
  * 
  * @param object Type $type
  * @return string
  * @access public
  * @since 3/1/06
  */
 function _getTypeId(Type $type)
 {
     if (!isset($this->_typeIds)) {
         $this->_typeIds = array();
     }
     if (!isset($this->_typeIds[$type->asString()])) {
         $dbc = Services::getService("DatabaseManager");
         $query = new SelectQuery();
         $query->addColumn("id");
         $query->addTable("log_type");
         $query->addWhere("domain = '" . addslashes($type->getDomain()) . "'");
         $query->addWhere("authority = '" . addslashes($type->getAuthority()) . "'");
         $query->addWhere("keyword = '" . addslashes($type->getKeyword()) . "'");
         $results = $dbc->query($query, $this->_dbIndex);
         if ($results->getNumberOfRows()) {
             $this->_typeIds[$type->asString()] = $results->field("id");
             $results->free();
         } else {
             $results->free();
             $query = new InsertQuery();
             $query->setTable("log_type");
             $query->setAutoIncrementColumn("id", "log_type_id_seq");
             $query->setColumns(array("domain", "authority", "keyword", "description"));
             $query->addRowOfValues(array("'" . addslashes($type->getDomain()) . "'", "'" . addslashes($type->getAuthority()) . "'", "'" . addslashes($type->getKeyword()) . "'", "'" . addslashes($type->getDescription()) . "'"));
             $results = $dbc->query($query, $this->_dbIndex);
             $this->_typeIds[$type->asString()] = $results->getLastAutoIncrementValue();
         }
     }
     return $this->_typeIds[$type->asString()];
 }
開發者ID:adamfranco,項目名稱:harmoni,代碼行數:38,代碼來源:HarmoniWritableLog.class.php


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