Ergaenze Stammdaten, Suche, Dimensionen, Abdeckung und Ausgabenachweis
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
7b54c38623
commit
5e763d15ec
23 files changed
+661
-5
No files matched your search
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Catalog;
|
||||
|
||||
class OfferCoverage
|
||||
{
|
||||
public function __construct(private readonly ContentResolver $resolver) {}
|
||||
|
||||
/**
|
||||
* @param list<LicenseArticle> $articles
|
||||
* @return list<string>
|
||||
*/
|
||||
public function missingLeaves(CompositionVersion $version, array $articles): array
|
||||
{
|
||||
$covered = [];
|
||||
|
||||
foreach ($articles as $article) {
|
||||
$release = $article->currentRelease;
|
||||
if ($release === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($release->contents()->pluck('content_element_version_id') as $id) {
|
||||
$covered[(int) $id] = true;
|
||||
}
|
||||
}
|
||||
|
||||
$missing = [];
|
||||
|
||||
foreach ($this->resolver->expand($version) as $row) {
|
||||
if (! isset($covered[$row['version_id']])) {
|
||||
$missing[] = $row['path'];
|
||||
}
|
||||
}
|
||||
|
||||
return $missing;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user