public function usersWorkflows(Member $user)
    {

        $groupIds = $user->Groups()->column('ID');

        $groupInstances = null;

        $filter = array('');

        if (is_array($groupIds)) {
            $groupInstances = DataList::create(WorkflowInstance::class)
                ->filter(array('Group.ID:ExactMatchMulti' => $groupIds))
                ->where('"WorkflowStatus" != \'Complete\'');
        }

        $userInstances = DataList::create(WorkflowInstance::class)
            ->filter(array('Users.ID:ExactMatch' => $user->ID))
            ->where('"WorkflowStatus" != \'Complete\'');

        if ($userInstances) {
            $userInstances = $userInstances->toArray();
        } else {
            $userInstances = array();
        }

        if ($groupInstances) {
            $groupInstances = $groupInstances->toArray();
        } else {
            $groupInstances = array();
        }

        $all = array_merge($groupInstances, $userInstances);

        return ArrayList::create($all);
    }
public function usersWorkflows(Member $user)
    {

        $groupIds = $user->Groups()->column('ID');

        $groupInstances = null;

        $filter = array('');

        if (is_array($groupIds)) {
            $groupInstances = DataList::create(WorkflowInstance::class)
                ->filter(array('Group.ID:ExactMatchMulti' => $groupIds))
                ->where('"WorkflowStatus" != \'Complete\'');
        }

        $userInstances = DataList::create(WorkflowInstance::class)
            ->filter(array('Users.ID:ExactMatch' => $user->ID))
            ->where('"WorkflowStatus" != \'Complete\'');

        if ($userInstances) {
            $userInstances = $userInstances->toArray();
        } else {
            $userInstances = array();
        }

        if ($groupInstances) {
            $groupInstances = $groupInstances->toArray();
        } else {
            $groupInstances = array();
        }

        $all = array_merge($groupInstances, $userInstances);

        return ArrayList::create($all);
    }
public function usersWorkflows ( Member $ user ) { $ groupIds = $ user -> Groups ( ) -> column ( 'ID' ) ; $ groupInstances = null ; $ filter = array ( '' ) ; if ( is_array ( $ groupIds ) ) { $ groupInstances = DataList :: create ( WorkflowInstance :: class ) -> filter ( array ( 'Group.ID:ExactMatchMulti' => $ groupIds ) ) -> where ( '"WorkflowStatus" != \'Complete\'' ) ; } $ userInstances = DataList :: create ( WorkflowInstance :: class ) -> filter ( array ( 'Users.ID:ExactMatch' => $ user -> ID ) ) -> where ( '"WorkflowStatus" != \'Complete\'' ) ; if ( $ userInstances ) { $ userInstances = $ userInstances -> toArray ( ) ; } else { $ userInstances = array ( ) ; } if ( $ groupInstances ) { $ groupInstances = $ groupInstances -> toArray ( ) ; } else { $ groupInstances = array ( ) ; } $ all = array_merge ( $ groupInstances , $ userInstances ) ; return ArrayList :: create ( $ all ) ; }
Get all the workflows that this user is responsible for

@param Member $user The user to get workflows for
@return ArrayList The list of workflow instances this user owns
Get all the workflows that this user is responsible for