Prose\UsingProvisioningDefinition::usePlaybook PHP Method

usePlaybook() public method

public usePlaybook ( $playbookName )
    public function usePlaybook($playbookName)
    {
        // build our callable
        $action = function ($def, $hostId) use($playbookName) {
            // what are we doing?
            $log = usingLog()->startAction("use top-level playbook '{$playbookName}' to host '{$hostId}'");
            // make sure we have an entry for this host
            if (!isset($def->{$hostId})) {
                $def->{$hostId} = new BaseObject();
            }
            // add the playbook
            $def->{$hostId}->playbook = $playbookName;
            // all done
            $log->endAction();
        };
        // build our return object
        $return = new DelayedProvisioningDefinitionAction($this->args[0], $action);
        // all done
        return $return;
    }