Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
nczirjak-acdh committed Jun 5, 2020
2 parents d147d41 + 0ac2ac9 commit f20413e
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 32 deletions.
4 changes: 2 additions & 2 deletions src/Helper/DetailViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private function getVocabsForDetailViewTable()
foreach ($vocabs[$this->siteLang] as $k => $v) {
//if we have the property inside our table results
if (isset($this->data[$k]) && count($this->data[$k]) > 0) {
if(isset($this->data[$k][$this->siteLang])) {
if (isset($this->data[$k][$this->siteLang])) {
foreach ($this->data[$k][$this->siteLang] as $tk => $tv) {
foreach ($vocabs[$this->siteLang][$k] as $vocab) {
if (isset($vocab->uri) && !empty($vocab->uri) && isset($tv->relvalue)) {
Expand All @@ -89,7 +89,7 @@ private function getVocabsForDetailViewTable()
}
}
}
}
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Helper/DisseminationServicesHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ private function createCollection()

/**
* Modify the collection data structure for the tree view
*
*
*/
private function modifyCollectionDataStructure()
{
Expand Down
26 changes: 13 additions & 13 deletions src/Model/ArcheApiModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ private function getData(): array
//run the actual query
try {
$query = $this->repodb->query(
"SELECT * from gui.apiGetData(:type, :searchStr)",
array(':type' => $this->properties->type,
"SELECT * from gui.apiGetData(:type, :searchStr)",
array(':type' => $this->properties->type,
':searchStr' => $this->properties->searchStr)
);
);

$result = $query->fetchAll(\PDO::FETCH_CLASS|\PDO::FETCH_GROUP);
} catch (Exception $ex) {
Expand All @@ -89,21 +89,21 @@ private function getData(): array
return $result;
}

/**
* Generate the Members data for the root repoid
*
* @return array
*/
/**
* Generate the Members data for the root repoid
*
* @return array
*/
private function getMembers(): array
{
$result = array();
//run the actual query
try {
$query = $this->repodb->query(
"SELECT * from gui.get_members_func(:repoid, :lang)",
array(':repoid' => $this->properties->repoid,
"SELECT * from gui.get_members_func(:repoid, :lang)",
array(':repoid' => $this->properties->repoid,
':lang' => $this->properties->lang)
);
);

$result = $query->fetchAll();
} catch (Exception $ex) {
Expand Down Expand Up @@ -204,7 +204,7 @@ private function getInverseData(): array
"SELECT * from gui.inverse_data_func(:repoid);",
array(
':repoid' => $this->properties->repoid
)
)
);
$result = $query->fetchAll(\PDO::FETCH_CLASS|\PDO::FETCH_GROUP);
} catch (Exception $ex) {
Expand Down Expand Up @@ -240,7 +240,7 @@ private function checkIdentifier(): array
);",
array(
':repoid' => $this->properties->repoid
)
)
);
$result = $query->fetchAll(\PDO::FETCH_CLASS);
} catch (Exception $ex) {
Expand Down
38 changes: 22 additions & 16 deletions src/Model/SearchViewModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,11 @@ private function countWordsFromDb(): int
}

try {
$query = $this->repodb->query("SELECT
$query = $this->repodb->query(
"SELECT
id
from gui.search_count_words_view_func(:wordStr, :lang, ".$typeStr.", :yearStr)",
array(
array(
':wordStr' => $wordStr,
':lang' => $this->siteLang,
// ':typeStr' => $typeStr,
Expand Down Expand Up @@ -210,10 +211,11 @@ private function countYearsFromDb(): int
}

try {
$query = $this->repodb->query("SELECT
$query = $this->repodb->query(
"SELECT
id
from gui.search_count_years_view_func(:yearStr, :lang, ".$typeStr.")",
array(
array(
':yearStr' => $yearsStr,
':lang' => $this->siteLang
)
Expand Down Expand Up @@ -248,10 +250,11 @@ private function countTypesFromDB(): int
}

try {
$query = $this->repodb->query("SELECT
$query = $this->repodb->query(
"SELECT
id
from gui.search_count_types_view_func(".$typeStr.", :lang, :yearStr)",
array(
array(
':lang' => $this->siteLang,
':yearStr' => $yearsStr
)
Expand Down Expand Up @@ -289,17 +292,18 @@ private function getWordsFromDB()
if (empty($typeStr)) {
$typeStr = "ARRAY[]::text[]";
}
//(_searchstr text, _lang text DEFAULT 'en', _limit text DEFAULT '10',
//_page text DEFAULT '0', _orderby text DEFAULT 'desc', _orderby_prop text DEFAULT 'avdate',
//(_searchstr text, _lang text DEFAULT 'en', _limit text DEFAULT '10',
//_page text DEFAULT '0', _orderby text DEFAULT 'desc', _orderby_prop text DEFAULT 'avdate',
//_rdftype text[] DEFAULT '{}', _acdhyears text DEFAULT '')

try {
$query = $this->repodb->query("SELECT
$query = $this->repodb->query(
"SELECT
*
from gui.search_words_view_func(
:wordStr, :lang, :limit, :offset,
:orderby, :orderby_column, ".$typeStr.", :yearStr)",
array(
array(
':wordStr' => $wordStr,
':lang' => $this->siteLang,
':limit' => $this->limit,
Expand Down Expand Up @@ -336,12 +340,13 @@ private function getTypesFromDB()
}

try {
$query = $this->repodb->query("SELECT
$query = $this->repodb->query(
"SELECT
*
from gui.search_types_view_func(
".$typeStr.", :lang, :limit, :offset,
:orderby, :orderby_column, :yearStr)",
array(
array(
':lang' => $this->siteLang,
':limit' => $this->limit,
':offset' => $this->offset,
Expand All @@ -365,7 +370,7 @@ private function getTypesFromDB()

/**
* Get the years from the database
*
*
* @return type
*/
private function getYearsFromDB()
Expand All @@ -377,15 +382,16 @@ private function getYearsFromDB()

if (empty($typeStr)) {
$typeStr = "ARRAY[]::text[]";
}
}

try {
$query = $this->repodb->query("SELECT
$query = $this->repodb->query(
"SELECT
*
from gui.search_years_view_func(
:yearStr, :lang, :limit, :offset,
:orderby, :orderby_column, ".$typeStr.")",
array(
array(
':lang' => $this->siteLang,
':limit' => $this->limit,
':offset' => $this->offset,
Expand Down

0 comments on commit f20413e

Please sign in to comment.