You are here

public function CmisConnectionApi::validObjectName in CMIS API 8

Same name and namespace in other branches
  1. 8.2 src/CmisConnectionApi.php \Drupal\cmis\CmisConnectionApi::validObjectName()
  2. 3.0.x src/CmisConnectionApi.php \Drupal\cmis\CmisConnectionApi::validObjectName()

Check the name is valid object.

Parameters

string $name:

string $type:

Return value

object the result object or empty array

File

src/CmisConnectionApi.php, line 288

Class

CmisConnectionApi
Description of CmisConnectionApi

Namespace

Drupal\cmis

Code

public function validObjectName($name, $type = 'cmis:folder', $parentId = '') {
  $query = "SELECT * FROM {$type} WHERE cmis:name='{$name}'";
  if (!empty($parentId)) {
    $query .= " and IN_FOLDER('{$parentId}')";
  }
  $result = $this->session
    ->query($query);
  return $result;
}