You are here

public function Common::toCheckboxes in Filebrowser 8.2

Same name and namespace in other branches
  1. 3.x 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\Services

Code

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;
}