/** * gets the current schema object * * @return schema current schema object */ public function getCurrentSchema() { $schema = false; if ($this->getRequestParameter('id')) { $this->file_import_history = FileImportHistoryPeer::retrieveByPk($this->getRequestParameter('id')); if (isset($this->file_import_history)) { $schema = $this->file_import_history->getSchema(); if ($this->file_import_history->getSchemaId()) { $schema = $this->file_import_history->getSchema(); } if ($this->file_import_history->getVocabularyId()) { $schema = $this->file_import_history->getVocabulary(); } } } if ($this->getRequestParameter('schema_id')) { $schema = SchemaPeer::retrieveByPk($this->getRequestParameter('schema_id')); $this->type = 'schema'; } if ($this->getRequestParameter('vocabulary_id')) { $schema = VocabularyPeer::retrieveByPk($this->getRequestParameter('vocabulary_id')); $this->type = 'vocabulary'; } if ($schema) { myActionTools::setLatestSchema($schema->getId()); } $this->forward404Unless($schema, 'No filter has been selected.'); $this->schema = $schema; $this->schemaID = $schema->getId(); return $schema; }
/** * gets the current schema object * * @return schema current schema object */ public function getCurrentSchema() { $schema = myActionTools::findCurrentSchema(); if (!$schema) { $this->schemaprop = SchemaPropertyPeer::retrieveByPk($this->getRequestParameter('id')); if (isset($this->schemaprop)) { $schema = $this->schemaprop->getSchema(); if ($schema) { myActionTools::setLatestSchema($schema->getId()); } } } $this->forward404Unless($schema, 'No Element Set has been selected.'); $this->schema = $schema; $this->schemaID = $schema->getId(); return $schema; }