本文整理汇总了PHP中Schema::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Schema::getId方法的具体用法?PHP Schema::getId怎么用?PHP Schema::getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Schema
的用法示例。
在下文中一共展示了Schema::getId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: retrievePrefixes
public function retrievePrefixes()
{
$prefixes = $this->schema->getPrefixes();
if ('schema' === $this->type) {
$namespaces = \SchemaPropertyElementPeer::getNamespaceList($this->schema->getId());
} else {
$namespaces = \VocabularyPeer::getNamespaceList($this->schema->getId());
}
//check the retrieved namespaces for a match to existing prefixes
foreach ($namespaces as $uri) {
//if we find the uri in existing schema prefixes, move on
if ($prefixes and array_search($uri, $prefixes) !== false) {
continue;
}
//look for it in Prefixes table
$namespacePrefix = \PrefixPeer::findByUri($uri);
if ($namespacePrefix) {
//add it to the prefix array
$prefixes[ $namespacePrefix->getPrefix() ] = $uri;
} //check it against the schema token
elseif (trim($uri, "/#") == trim($this->schema->getUri(), "#/")) {
$prefixes[ $this->schema->getToken() ] = $uri;
} else {
$prefixes[ ] = $uri;
}
}
if (empty($prefixes)) {
$prefixes = $this->getDefaultPrefix();
}
return $prefixes;
}
示例2: __construct
/**
* AccessTable constructor
*
* @param Schema $schema The schema valid at $ts
* @param string|int $pid
* @param int $ts Time at which the data should be read or written, 0 for now
*/
public function __construct(Schema $schema, $pid, $ts = 0)
{
/** @var \helper_plugin_struct_db $helper */
$helper = plugin_load('helper', 'struct_db');
$this->sqlite = $helper->getDB();
if (!$this->sqlite) {
throw new StructException('Sqlite plugin required');
}
if (!$schema->getId()) {
throw new StructException('Schema does not exist. Only data of existing schemas can be accessed');
}
$this->schema = $schema;
$this->pid = $pid;
$this->setTimestamp($ts);
foreach ($this->schema->getColumns() as $col) {
$this->labels[$col->getColref()] = $col->getType()->getLabel();
}
}
示例3: run_import_list
//.........这里部分代码省略.........
if (empty($row["VES"])) {
//skip this one
break;
}
$uri = $baseDomain . $row["VES"] . "#";
$vocab = VocabularyPeer::getVocabularyByUri($uri);
$updateTime = time();
if (! $vocab) {
// create a new concept or element
$vocab = new Vocabulary();
$vocab->setUri($uri);
$vocab->setCreatedAt($updateTime);
$vocab->setCreatedUserId($userId);
$vocab->setAgentId($agentID);
$vocab->setBaseDomain($baseDomain);
$vocab->setCommunity("Libraries, MARC21");
$vocab->setLanguage("en");
$vocab->setStatusId(1);
} else {
$vocab->setLastUpdated($updateTime);
$vocab->setUpdatedUserId($userId);
}
$vocab->setName(fixEncoding(rtrim($row['Name'])));
$vocab->setNote(fixEncoding(rtrim($row['Note'])));
$vocab->setToken($row['VES']);
$vocab->save();
//type
$args[0] = "vocab";
//vocabid
$args[2] = $vocab->getId();
//filepath
$args[1] = $GLOBALS['uploadPath'] . $row['VES'] . ".csv";
$args[3] = $batchId;
$args[4] = "-d";
run_import_vocabulary($importTask, $args);
$foo = $vocab->countConcepts();
}
} catch(Exception $e) {
throw new Exception($e);
}
} else //it's a schema
{
try {
while ($row = $reader->getRow()) {
//NOTE: this is explicitly tuned to a particular import file
//TODO: generalize this import mapping
// lookup the URI (or the OMR ID if available) for a match
if (empty($row["URI"])) {
//skip this one
break;
}
$uri = $row["URI"];
$schema = SchemaPeer::getschemaByUri($uri);
$updateTime = time();
if (! $schema) {
// create a new vocabulary
$schema = new Schema();
示例4: setSchema
/**
* Declares an association between this object and a Schema object.
*
* @param Schema $v
* @return void
* @throws PropelException
*/
public function setSchema($v)
{
if ($v === null) {
$this->setSchemaId(NULL);
} else {
$this->setSchemaId($v->getId());
}
$this->aSchema = $v;
}