public function getDefinitionByID($object, $workflowID)
    {
        // Make sure the correct extensions have been applied to the data object.

        $workflow = null;
        if ($object->hasExtension(WorkflowApplicable::class)
            || $object->hasExtension(FileWorkflowApplicable::class)
        ) {
            // Validate the workflow ID against the data object.

            if (($object->WorkflowDefinitionID == $workflowID)
                || ($workflow = $object->AdditionalWorkflowDefinitions()->byID($workflowID))
            ) {
                if (is_null($workflow)) {
                    $workflow = DataObject::get_by_id(WorkflowDefinition::class, $workflowID);
                }
            }
        }
        return $workflow ? $workflow : null;
    }