protected function EntityWorkflowUIController::overviewTableRow in Workflow 7.2
Generates the row for the passed entity and may be overridden in order to customize the rows.
Parameters
$additional_cols: Additional columns to be added after the entity label column.
Overrides EntityDefaultUIController::overviewTableRow
File
- workflow_admin_ui/
includes/ Entity/ EntityWorkflowUIController.php, line 126 - Contains workflow_admin_ui\includes\Entity\EntityWorkflowUIController.
Class
- EntityWorkflowUIController
- @file Contains workflow_admin_ui\includes\Entity\EntityWorkflowUIController.
Code
protected function overviewTableRow($conditions, $id, $entity, $additional_cols = array()) {
// Avoid the 'delete' operation if the Workflow is used somewhere.
$status = $entity->status;
// @see parent::overviewTableRow() how to determine a deletable entity.
if (!entity_has_status($this->entityType, $entity, ENTITY_IN_CODE) && !$entity
->isDeletable()) {
// Set to a state that does not allow deleting, but allows other actions.
$entity->status = ENTITY_IN_CODE;
}
$row = parent::overviewTableRow($conditions, $id, $entity, $additional_cols);
// Just to be sure: reset status.
$entity->status = $status;
return $row;
}