Changeset ef86d4f in iPeer


Ignore:
Timestamp:
2013-09-04T15:31:20-07:00 (4 years ago)
Author:
Compass <pan.luo@…>
Branches:
3.1.x, dev, master
Children:
c1e63fd, ea25c75
Parents:
88db010
git-author:
Compass <pan.luo@…> (09/04/2013 03:31:01 PM)
git-committer:
Compass <pan.luo@…> (09/04/2013 03:31:20 PM)
Message:

Add missing functions which was delete by merge

Location:
app
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • app/controllers/users_controller.php

    r88db010 ref86d4f  
    13241324
    13251325    /**
    1326 <<<<<<< HEAD
    13271326     * _updateCreatorUpdaterId
    13281327     *
  • app/models/user.php

    r88db010 ref86d4f  
    962962
    963963    /**
    964      * Get courses a user is enrolled in
    965      *
    966      * @param mixed $userId user id
    967      *
    968      * @return list of course ids
    969      */
    970     function getEnrolledCourses($userId='')
    971     {
    972         $user = $this->find('first', array(
    973             'conditions' => array('User.id' => $userId),
    974             'contain' => array('Enrolment')
    975         ));
    976         return Set::extract($user, '/Enrolment/id');
    977     }
    978 
    979     /**
    980964     * getFullNames
    981965     * Get first and last names of user(s)
     
    10441028
    10451029        return $groupMembers;
     1030    }
     1031
     1032    /**
     1033     * Get courses a user is enrolled in
     1034     *
     1035     * @param mixed $userId user id
     1036     *
     1037     * @return list of course ids
     1038     */
     1039    function getEnrolledCourses($userId='')
     1040    {
     1041        $user = $this->find('first', array(
     1042            'conditions' => array('User.id' => $userId),
     1043            'contain' => array('Enrolment')
     1044        ));
     1045        return Set::extract($user, '/Enrolment/id');
     1046    }
     1047
     1048    /**
     1049     * Get courses a tutor is enrolled in
     1050     *
     1051     * @param mixed $userId user id
     1052     *
     1053     * @return list of course ids
     1054     */
     1055    function getTutorCourses($userId='')
     1056    {
     1057        $user = $this->find('first', array(
     1058            'conditions' => array('User.id' => $userId),
     1059            'contain' => array('Tutor')
     1060        ));
     1061        return Set::extract($user, '/Tutor/id');
     1062    }
     1063
     1064    /**
     1065     * Get courses an instructor is enrolled in
     1066     *
     1067     * @param mixed $userId user id
     1068     *
     1069     * @return list of course ids
     1070     */
     1071    function getInstructorCourses($userId='')
     1072    {
     1073        $user = $this->find('first', array(
     1074            'conditions' => array('User.id' => $userId),
     1075            'contain' => array('Course')
     1076        ));
     1077        return Set::extract($user, '/Course/id');
    10461078    }
    10471079
Note: See TracChangeset for help on using the changeset viewer.