0
0
Fork 0
mirror of https://github.com/verdigado/organization_folders.git synced 2024-11-25 06:00:28 +01:00
organization_folders/lib/Command/BaseCommand.php

37 lines
1.2 KiB
PHP

<?php
namespace OCA\OrganizationFolders\Command;
use OC\Core\Command\Base;
use OCP\IDateTimeFormatter;
use OCA\OrganizationFolders\Service\OrganizationFolderService;
use OCA\OrganizationFolders\Service\ResourceService;
use OCA\OrganizationFolders\Service\ResourceMemberService;
use OCA\OrganizationFolders\OrganizationProvider\OrganizationProviderManager;
use OCA\OrganizationFolders\Interface\TableSerializable;
abstract class BaseCommand extends Base {
public function __construct(
private readonly IDateTimeFormatter $dateTimeFormatter,
protected readonly OrganizationFolderService $organizationFolderService,
protected ResourceService $resourceService,
protected ResourceMemberService $resourceMemberService,
protected OrganizationProviderManager $organizationProviderManager,
) {
parent::__construct();
}
protected function formatTableSerializable(TableSerializable $serializable, ?array $params = null): array {
return $serializable->tableSerialize($params);
}
protected function formatTableSerializables(array $serializables, ?array $params = null): array {
$result = [];
foreach($serializables as $serializable) {
$result[] = $serializable->tableSerialize($params);
}
return $result;
}
}