public function cleanupVendors(Storage $storage, callable $callback = null)
    {
        $count = 0;
        $storageNode = $storage->node();
        $query = new FlowQuery([$storageNode]);
        $query = $query->find('[instanceof Neos.MarketPlace:Vendor]');
        foreach ($query as $vendor) {
            /** @var NodeInterface $vendor */
            $hasPackageQuery = new FlowQuery([$vendor]);
            $packageCount = $hasPackageQuery->find('[instanceof Neos.MarketPlace:Package]')->count();
            if ($packageCount > 0) {
                continue;
            }
            $vendor->remove();
            if ($callback !== null) {
                $callback($vendor);
            }
            $this->emitVendorDeleted($vendor);
            $count++;
        }
        return $count;
    }
public function cleanupVendors(Storage $storage, callable $callback = null)
    {
        $count = 0;
        $storageNode = $storage->node();
        $query = new FlowQuery([$storageNode]);
        $query = $query->find('[instanceof Neos.MarketPlace:Vendor]');
        foreach ($query as $vendor) {
            /** @var NodeInterface $vendor */
            $hasPackageQuery = new FlowQuery([$vendor]);
            $packageCount = $hasPackageQuery->find('[instanceof Neos.MarketPlace:Package]')->count();
            if ($packageCount > 0) {
                continue;
            }
            $vendor->remove();
            if ($callback !== null) {
                $callback($vendor);
            }
            $this->emitVendorDeleted($vendor);
            $count++;
        }
        return $count;
    }
public function cleanupVendors ( Storage $ storage , callable $ callback = null ) { $ count = 0 ; $ storageNode = $ storage -> node ( ) ; $ query = new FlowQuery ( [ $ storageNode ] ) ; $ query = $ query -> find ( '[instanceof Neos.MarketPlace:Vendor]' ) ; foreach ( $ query as $ vendor ) { /** @var NodeInterface $vendor */ $ hasPackageQuery = new FlowQuery ( [ $ vendor ] ) ; $ packageCount = $ hasPackageQuery -> find ( '[instanceof Neos.MarketPlace:Package]' ) -> count ( ) ; if ( $ packageCount > 0 ) { continue ; } $ vendor -> remove ( ) ; if ( $ callback !== null ) { $ callback ( $ vendor ) ; } $ this -> emitVendorDeleted ( $ vendor ) ; $ count ++ ; } return $ count ; }
Remove vendors without packages

@param Storage $storage
@param callable $callback function called after the vendor removal
@return integer
Remove vendors without packages