Skip to content

Commit

Permalink
#21883
Browse files Browse the repository at this point in the history
  • Loading branch information
nczirjak-acdh committed Jul 27, 2023
1 parent d98d1c8 commit 10ac362
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Model/OntologyTwigExtensionModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,20 @@ public function getViewData(): array
*/
private function getImportDate(): array
{

try {
$this->setSqlTimeout();
$query = $this->drupalDb->query(
"select i.id,
(select mv.value from metadata_view as mv where mv.id = i.id and mv.property = :avdate)
(select mv.value from metadata_view as mv where mv.id = i.id and mv.property = :avdate),
(select mv2.value as version from metadata_view as mv2 where mv2.id = i.id and mv2.property = :version)
from identifiers as i
where
i.ids = 'https://vocabs.acdh.oeaw.ac.at/schema' limit 1
",
array(
':avdate' => $this->repoDb->getSchema()->creationDate
':avdate' => $this->repoDb->getSchema()->creationDate,
':version' => $this->repoDb->getSchema()->ontology->version
)
);
$this->dbResult = $query->fetchAssoc();
Expand Down
5 changes: 5 additions & 0 deletions src/TwigExtension/OntologyTwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ public function get_acdh_ontology_import_date()
if (isset($importDate['value'])) {
$date = new \DateTime($importDate['value']);
$this->str = "Ontology import date: ".$date->format('Y-m-d H:i:s');

}

if (isset($importDate['version'])) {
$this->str .= " | Ontology version: ".$importDate['version'];
}

return $this->str;
}
Expand Down

0 comments on commit 10ac362

Please sign in to comment.