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/Traits/ApiObjectController.php

34 lines
609 B
PHP
Raw Normal View History

<?php
namespace OCA\OrganizationFolders\Traits;
trait ApiObjectController {
public const MODEL_INCLUDE = 'model';
/**
* @param string $include
*
* @return array
*/
public function parseIncludesString(?string $include): array {
if (isset($include)) {
$includes = array_filter(explode('+', $include));
if (!!$includes) {
return $includes;
}
}
return [self::MODEL_INCLUDE];
}
/**
* @param string $test
* @param array $includes
*
* @return boolean
*/
public function shouldInclude(string $test, array $includes): bool {
return in_array($test, $includes);
}
}