mirror of
https://github.com/verdigado/organization_folders.git
synced 2024-12-06 11:22:41 +01:00
added resource occ commands
This commit is contained in:
parent
0f81059343
commit
840fd70c37
8 changed files with 169 additions and 2 deletions
34
lib/Command/BaseCommand.php
Normal file
34
lib/Command/BaseCommand.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
namespace OCA\OrganizationFolders\Command;
|
||||
|
||||
use OC\Core\Command\Base;
|
||||
use OCP\IDateTimeFormatter;
|
||||
|
||||
use OCA\OrganizationFolders\Model\OrganizationFolder;
|
||||
use OCA\OrganizationFolders\Service\OrganizationFolderService;
|
||||
use OCA\OrganizationFolders\Service\ResourceService;
|
||||
use OCA\OrganizationFolders\Interface\TableSerializable;
|
||||
|
||||
abstract class BaseCommand extends Base {
|
||||
|
||||
public function __construct(
|
||||
private readonly IDateTimeFormatter $dateTimeFormatter,
|
||||
protected readonly OrganizationFolderService $organizationFolderService,
|
||||
protected ResourceService $resourceService,
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
protected function formatTableSerializable(TableSerializable $serializable): array {
|
||||
return $serializable->tableSerialize();
|
||||
}
|
||||
|
||||
protected function formatOrganizationFolders(array $organizationFolders) {
|
||||
return array_map($this->formatTableSerializable(...), $organizationFolders);
|
||||
}
|
||||
|
||||
protected function formatResources(array $resources): array {
|
||||
return array_map($this->formatTableSerializable(...), $resources);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue