public function CmisConnectionApi::hasAllowableActionById in CMIS API 8.2
Same name and namespace in other branches
- 3.0.x src/CmisConnectionApi.php \Drupal\cmis\CmisConnectionApi::hasAllowableActionById()
Check if object id has the allowable action.
Parameters
string $id: CMIS object ID.
string $action: Get action.
Return value
bool Return TRUE if object id has the allowable action.
File
- src/
CmisConnectionApi.php, line 373
Class
- CmisConnectionApi
- Description of CmisConnectionApi.
Namespace
Drupal\cmisCode
public function hasAllowableActionById($id, $action) {
if (empty($id)) {
return FALSE;
}
$cid = $this->session
->createObjectId($id);
$object = $this->session
->getObject($cid);
$get_actions = $object
->getAllowableActions()
->getAllowableActions();
foreach ($get_actions as $get_action) {
if ($get_action
->equals($action)) {
return TRUE;
}
}
return FALSE;
}