public function Common::toCheckboxes in Filebrowser 3.x
Same name and namespace in other branches
- 8.2 src/Services/Common.php \Drupal\filebrowser\Services\Common::toCheckboxes()
Converts array of properties for use as checkboxes
Parameters
$properties:
Return value
array
File
- src/
Services/ Common.php, line 92
Class
- Common
- Class Common @package Drupal\filebrowser\Services
Namespace
Drupal\filebrowser\ServicesCode
public function toCheckboxes($properties) {
$result = [];
if ($properties) {
foreach ($properties as $key => $arr) {
if ($arr) {
if (isset($arr['title'])) {
$result[$key] = $arr['title'];
}
else {
$result[$key] = $key;
}
}
}
}
return $result;
}