当前位置: 首页>>代码示例>>PHP>>正文


PHP Schema::addField方法代码示例

本文整理汇总了PHP中Schema::addField方法的典型用法代码示例。如果您正苦于以下问题:PHP Schema::addField方法的具体用法?PHP Schema::addField怎么用?PHP Schema::addField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Schema的用法示例。


在下文中一共展示了Schema::addField方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: HarmoniRepositoryManager

 /**
  * Constructor
  * @param array $configuration	An array of the configuration options 
  * nessisary to load this manager. To use the a specific manager store, a 
  * store data source must be configured as noted in the class of said 
  * manager store.
  * manager.
  * @access public
  */
 function HarmoniRepositoryManager($configuration = NULL)
 {
     // Define the type to use as a key for Identifying repositories
     $this->repositoryKeyType = new HarmoniType("Repository", "edu.middlebury.harmoni", "Repository", "Nodes with this type are by definition Repositories.");
     // Cache any created repositories so that we can pass out references to them.
     $this->_createdRepositories = array();
     $schemaMgr = Services::getService("SchemaManager");
     $ids = Services::getService("Id");
     $recordStructureId = $ids->getId("edu.middlebury.harmoni.repository.asset_content");
     $recordDesc = "A RecordStructure for the generic content of an asset.";
     if (!$schemaMgr->schemaExists($recordStructureId->getIdString())) {
         // Create the Schema
         $schema = new Schema($recordStructureId->getIdString(), "Repository Asset Content", 1, $recordDesc);
         $schema->addField(new SchemaField("Content", "Content", "blob", "The binary content of the Asset"));
         $schemaMgr->synchronize($schema);
         // The SchemaManager only allows you to use Schemas created by it for use with Records.
         $schema = $schemaMgr->getSchemaByID($recordStructureId->getIdString());
         debug::output("RecordStructure is being created from Schema with Id: '" . $schema->getID() . "'");
         $nullRepositoryId = $ids->getId('null');
         $this->_createdRecordStructures[$schema->getID()] = new HarmoniRecordStructure($this, $schema, $nullRepositoryId);
         // Add the parts to the schema
         //			$partStructureType = new Type("Repository", "edu.middlebury.harmoni", "Blob", "");
         //			$this->_createdRecordStructures[$schema->getID()]->createPartStructure(
         //																"Content",
         //																"The binary content of the Asset",
         //																$partStructureType,
         //																FALSE,
         //																FALSE,
         //																FALSE,
         //																$ids->getId("edu.middlebury.harmoni.repository.asset_content.Content")
         //																);
     }
 }
开发者ID:adamfranco,项目名称:harmoni,代码行数:42,代码来源:HarmoniRepositoryManager.class.php

示例2: deepCopy

 /**
  * bla! - deepCopy baby!
  * @return ref object
  * @access public
  */
 function deepCopy()
 {
     $schema = new Schema($this->getID(), $this->getDisplayName(), $this->getRevision(), $this->getDescription(), $this->getOtherParameters());
     foreach (array_keys($this->_fields) as $key) {
         $field = $this->_fields[$key];
         $newField = $field->replicate();
         $schema->addField($newField);
     }
     return $schema;
 }
开发者ID:adamfranco,项目名称:harmoni,代码行数:15,代码来源:Schema.class.php

示例3: getSchema

 function getSchema($id)
 {
     $id = strtolower($id);
     $type = 'schema';
     $row = $this->database->getSchemaDescription($id);
     $typePage = $row[2];
     $json = new Schema($row[0], $row[1], $row[2]);
     if ($typePage == 'array') {
         $json->addItems('type', 'object');
         $properties = array();
     } else {
         unset($json->items);
     }
     $rows = $this->database->getFormFields($id, $type);
     foreach ($rows as $row) {
         $rowsI = $this->database->getFormFieldsTypes($id, $type, $row[0]);
         if ($typePage == 'array') {
             $properties[$row[0]] = $json->addField($rowsI);
         } else {
             $campo = $json->addField($rowsI);
             $json->addProperties($row[0], $campo);
         }
     }
     if ($typePage == 'array') {
         $json->addItems("properties", $properties);
         unset($json->properties);
     }
     return $json;
 }
开发者ID:nabusas,项目名称:Nabu,代码行数:29,代码来源:Utilities.php


注:本文中的Schema::addField方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。