concrete/src/Workflow/Progress/Progress.php
public static function create($wpCategoryHandle, Workflow $wf, WorkflowRequest $wr)
    {
        $db = Database::connection();
        $wpDateAdded = Core::make('helper/date')->getOverridableNow();
        $wpCategoryID = $db->fetchColumn('select wpCategoryID from WorkflowProgressCategories where wpCategoryHandle = ?', array($wpCategoryHandle));
        $db->executeQuery('insert into WorkflowProgress (wfID, wrID, wpDateAdded, wpCategoryID) values (?, ?, ?, ?)', array(
            $wf->getWorkflowID(), $wr->getWorkflowRequestID(), $wpDateAdded, $wpCategoryID,
        ));
        $wp = self::getByID($db->lastInsertId());
        $wp->addWorkflowProgressHistoryObject($wr);


        if (!($wf instanceof EmptyWorkflow)) {
            $application = \Core::getFacadeApplication();
            $type = $application->make('manager/notification/types')->driver('workflow_progress');
            $notifier = $type->getNotifier();
            $subscription = $type->getSubscription($wp);
            $notified = $notifier->getUsersToNotify($subscription, $wp);
            $notification = $type->createNotification($wp);
            $notifier->notify($notified, $notification);
        }

        return $wp;
    }
public static function create($wpCategoryHandle, Workflow $wf, WorkflowRequest $wr)
    {
        $db = Database::connection();
        $wpDateAdded = Core::make('helper/date')->getOverridableNow();
        $wpCategoryID = $db->fetchColumn('select wpCategoryID from WorkflowProgressCategories where wpCategoryHandle = ?', array($wpCategoryHandle));
        $db->executeQuery('insert into WorkflowProgress (wfID, wrID, wpDateAdded, wpCategoryID) values (?, ?, ?, ?)', array(
            $wf->getWorkflowID(), $wr->getWorkflowRequestID(), $wpDateAdded, $wpCategoryID,
        ));
        $wp = self::getByID($db->lastInsertId());
        $wp->addWorkflowProgressHistoryObject($wr);


        if (!($wf instanceof EmptyWorkflow)) {
            $application = \Core::getFacadeApplication();
            $type = $application->make('manager/notification/types')->driver('workflow_progress');
            $notifier = $type->getNotifier();
            $subscription = $type->getSubscription($wp);
            $notified = $notifier->getUsersToNotify($subscription, $wp);
            $notification = $type->createNotification($wp);
            $notifier->notify($notified, $notification);
        }

        return $wp;
    }
public static function create ( $ wpCategoryHandle , Workflow $ wf , WorkflowRequest $ wr ) { $ db = Database :: connection ( ) ; $ wpDateAdded = Core :: make ( 'helper/date' ) -> getOverridableNow ( ) ; $ wpCategoryID = $ db -> fetchColumn ( 'select wpCategoryID from WorkflowProgressCategories where wpCategoryHandle = ?' , array ( $ wpCategoryHandle ) ) ; $ db -> executeQuery ( 'insert into WorkflowProgress (wfID, wrID, wpDateAdded, wpCategoryID) values (?, ?, ?, ?)' , array ( $ wf -> getWorkflowID ( ) , $ wr -> getWorkflowRequestID ( ) , $ wpDateAdded , $ wpCategoryID , ) ) ; $ wp = self :: getByID ( $ db -> lastInsertId ( ) ) ; $ wp -> addWorkflowProgressHistoryObject ( $ wr ) ; if ( ! ( $ wf instanceof EmptyWorkflow ) ) { $ application = \ Core :: getFacadeApplication ( ) ; $ type = $ application -> make ( 'manager/notification/types' ) -> driver ( 'workflow_progress' ) ; $ notifier = $ type -> getNotifier ( ) ; $ subscription = $ type -> getSubscription ( $ wp ) ; $ notified = $ notifier -> getUsersToNotify ( $ subscription , $ wp ) ; $ notification = $ type -> createNotification ( $ wp ) ; $ notifier -> notify ( $ notified , $ notification ) ; } return $ wp ; }
Creates a WorkflowProgress object (which will be assigned to a Page, File, etc... in our system.

@param string $wpCategoryHandle
@param Workflow $wf
@param WorkflowRequest $wr

@return self
Creates a WorkflowProgress object ( which will be assigned to a Page File etc ... in our system .