get_course

Description

Returns an etsis_Course object with the information connected to the unique course’s ID.

Usage

<?php $crse = get_course($course, $object); ?>

Parameters

$course (string) (required) Unique course ID or course array of data pulled for requested course.

$object (bool) (optional) It set true, the data will return as an object or an array if false.

Return Values

(mixed) etsis_Course object or array on success or false if failed.

Example

Example of return data as an object.

$crse = get_course(5);
echo "Course code is " . $crse->courseCode;

Example of returning data as an array.

$crse = get_course(5, false);
echo "Course code is " . $crse['courseCode'];

var_dump of $crse = get_course(5); as an object

stdClass::__set_state(array(
   'courseID' => '5',
   'courseNumber' => '2142',
   'courseCode' => 'EMATH-2142',
   'subjectCode' => 'EMATH',
   'deptCode' => 'MATH',
   'courseDesc' => '<p>This course provides a general introduction to the basic concepts of probability and descriptive statistics.</p>
',
   'creditType' => 'I',
   'minCredit' => '3.0',
   'maxCredit' => '0.0',
   'increCredit' => '0.0',
   'courseLevelCode' => '200',
   'acadLevelCode' => 'UG',
   'courseShortTitle' => 'Introduction to Statistic',
   'courseLongTitle' => 'Introduction to Statistics',
   'preReq' => '',
   'allowAudit' => '1',
   'allowWaitlist' => '0',
   'minEnroll' => '12',
   'seatCap' => '30',
   'startDate' => '2013-09-01',
   'endDate' => '0000-00-00',
   'currStatus' => 'A',
   'statusDate' => '2014-03-01',
   'approvedDate' => '2013-09-01',
   'approvedBy' => '1',
   'LastUpdate' => '2015-06-27 21:52:33',
))

var_dump of $crse = get_course(5, false); as an array

array (
  'courseID' => '5',
  'courseNumber' => '2142',
  'courseCode' => 'EMATH-2142',
  'subjectCode' => 'EMATH',
  'deptCode' => 'MATH',
  'courseDesc' => '<p>This course provides a general introduction to the basic concepts of probability and descriptive statistics.</p>
',
  'creditType' => 'I',
  'minCredit' => '3.0',
  'maxCredit' => '0.0',
  'increCredit' => '0.0',
  'courseLevelCode' => '200',
  'acadLevelCode' => 'UG',
  'courseShortTitle' => 'Introduction to Statistic',
  'courseLongTitle' => 'Introduction to Statistics',
  'preReq' => '',
  'allowAudit' => '1',
  'allowWaitlist' => '0',
  'minEnroll' => '12',
  'seatCap' => '30',
  'startDate' => '2013-09-01',
  'endDate' => '0000-00-00',
  'currStatus' => 'A',
  'statusDate' => '2014-03-01',
  'approvedDate' => '2013-09-01',
  'approvedBy' => '1',
  'LastUpdate' => '2015-06-27 21:52:33',
)

Change Log

Since 6.2.0

Source File

get_course() is located in app/functions/course-function.php.