2024-10-30 04:45:56 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace OCA\OrganizationFolders\Command;
|
|
|
|
|
|
|
|
use OC\Core\Command\Base;
|
|
|
|
use OCP\IDateTimeFormatter;
|
|
|
|
|
|
|
|
use OCA\OrganizationFolders\Service\OrganizationFolderService;
|
|
|
|
use OCA\OrganizationFolders\Service\ResourceService;
|
2024-10-31 17:29:15 +01:00
|
|
|
use OCA\OrganizationFolders\Service\ResourceMemberService;
|
2024-11-03 02:19:17 +01:00
|
|
|
use OCA\OrganizationFolders\OrganizationProvider\OrganizationProviderManager;
|
2024-10-30 04:45:56 +01:00
|
|
|
use OCA\OrganizationFolders\Interface\TableSerializable;
|
|
|
|
|
|
|
|
abstract class BaseCommand extends Base {
|
|
|
|
|
|
|
|
public function __construct(
|
|
|
|
private readonly IDateTimeFormatter $dateTimeFormatter,
|
|
|
|
protected readonly OrganizationFolderService $organizationFolderService,
|
|
|
|
protected ResourceService $resourceService,
|
2024-10-31 17:29:15 +01:00
|
|
|
protected ResourceMemberService $resourceMemberService,
|
2024-11-03 02:19:17 +01:00
|
|
|
protected OrganizationProviderManager $organizationProviderManager,
|
2024-10-30 04:45:56 +01:00
|
|
|
) {
|
|
|
|
parent::__construct();
|
|
|
|
}
|
|
|
|
|
2024-10-31 17:29:15 +01:00
|
|
|
protected function formatTableSerializable(TableSerializable $serializable, ?array $params = null): array {
|
|
|
|
return $serializable->tableSerialize($params);
|
2024-10-30 04:45:56 +01:00
|
|
|
}
|
|
|
|
|
2024-10-31 17:29:15 +01:00
|
|
|
protected function formatTableSerializables(array $serializables, ?array $params = null): array {
|
|
|
|
$result = [];
|
|
|
|
foreach($serializables as $serializable) {
|
|
|
|
$result[] = $serializable->tableSerialize($params);
|
|
|
|
}
|
|
|
|
return $result;
|
2024-10-30 04:45:56 +01:00
|
|
|
}
|
|
|
|
}
|