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;
    }
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;
    }
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 ; }
Retrieves a workflow definition by ID for a data object.

@param DataObject $object
@param integer $workflowID
@return WorkflowDefinition|null
Retrieves a workflow definition by ID for a data object .