We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8a9ee16 commit 858c20bCopy full SHA for 858c20b
src/DataSource/Lca/Boaviztapi/Client.php
@@ -100,20 +100,11 @@ public function get(string $endpoint, array $options = []): array
100
*/
101
public function createSource(): bool
102
{
103
- $source_name = $this->getSourceName();
104
// create a source in Source
105
$source = new Source();
106
- $source->getFromDBByCrit([
107
- 'name' => $source_name,
108
- ]);
109
- if ($source->isNewItem()) {
110
- $id = $source->add([
111
112
113
- return !$source->isNewID($id);
114
- }
+ $source->getOrCreate([], ['name' => $this->getSourceName()]);
115
116
- return true;
+ return (!$source->isNewItem());
117
}
118
119
/**
0 commit comments