You are here

protected function CmisElement::prepare in CMIS API 8.2

Same name and namespace in other branches
  1. 8 src/CmisElement.php \Drupal\cmis\CmisElement::prepare()
  2. 3.0.x src/CmisElement.php \Drupal\cmis\CmisElement::prepare()

Prepare element data.

1 call to CmisElement::prepare()
CmisElement::setElement in src/CmisElement.php
Set element.

File

src/CmisElement.php, line 118

Class

CmisElement
Description of CmisElement.

Namespace

Drupal\cmis

Code

protected function prepare() {
  $type_id = $this->element
    ->getBaseTypeId()
    ->__toString();
  $name = $this->element
    ->getName();
  $id = $this->element
    ->getId();
  switch ($type_id) {
    case 'cmis:folder':
      $this
        ->prepareElement('cmis_browser_folder_item', $name, $id);
      break;
    case 'cmis:document':
      $this
        ->prepareElement('cmis_browser_document_item', $name, $id);
      break;
    default:
      $element = [
        '#theme' => 'cmis_browser_other_item',
        '#element' => $name,
      ];
      $this->data = [
        render($element),
      ];
  }
}