Skip to content
Code-Schnipsel Gruppen Projekte
Bestätigt Commit 43cee957 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

feat(Process): custom filter method at getGroupedRelatedTransactionEntities

Übergeordneter 9349f018
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
2 Merge Requests!82feat: own template for articles at the article list,!81feat: own template for articles at the article list
......@@ -13,6 +13,9 @@
use function array_merge;
use function class_exists;
use function count;
use function get_class;
use function in_array;
use function is_callable;
use function strtotime;
/**
......@@ -87,15 +90,22 @@ public function getEntities(): array
* The primary function is to categorize these ERP entities based on their relationships and associations,
* facilitating easier management and retrieval of related transactional data within the ERP system.
*
* @param callable|null $filterEntityTypes - own filter function
* @return array
*/
public function getGroupedRelatedTransactionEntities(): array
public function getGroupedRelatedTransactionEntities(?callable $filterEntityTypes = null): array
{
$entities = $this->getEntities();
$entities = array_filter($entities, function ($obj) {
return $obj instanceof ErpTransactionsInterface;
});
if (is_callable($filterEntityTypes)) {
$entities = array_filter($entities, $filterEntityTypes);
}
$groups = [];
// invoices into the groups
if (
class_exists('QUI\ERP\Accounting\Invoice\Invoice')
......
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren