PHRAS-3722 : bin/console records:build-subdef (#4450)

* fix

* PHRAS-4001

* - allow to prune without building
- require --confirm to prune and build in the same time

---------
Co-authored-by: jygaulier <gaulier@alchemy.fr>
This commit is contained in:
Aina Sitraka
2023-12-29 17:55:31 +03:00
committed by GitHub
parent 39ef540c15
commit 7768ebfb4b
2 changed files with 46 additions and 5 deletions

View File

@@ -745,6 +745,19 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
return $this->subdefs;
}
/**
* @return media_subdef[]
*/
public function get_subdefs_from_db()
{
$subdefs = [];
foreach ($this->getMediaSubdefRepository()->findByRecordIdsAndNames([$this->getRecordId()]) as $subdef) {
$subdefs[$subdef->get_name()] = $subdef;
}
return $subdefs;
}
/**
* @return string[]
*/