public function findClasses($class) { try { $queryObject = array('queryObject' => json_encode(array('coursesection_title' => $class->getTitle(), 'date_from' => $class->getDateFrom(), 'integration_id' => $class->getIntegrationId(), 'user_id' => $class->getUserId(), 'user_role' => $class->getUserRole()))); $soap = $this->discoverCourseSectionIds($queryObject); $response = new Response($this); if ($response->getStatus() == 'error') { throw new TurnitinSDKException($response->getStatusCode(), $response->getDescription(), parent::getLogPath()); } else { $tiiClass = new TiiClass(); $classids = array(); if (isset($soap->sourcedIdSet->sourcedId)) { if (!is_array($soap->sourcedIdSet->sourcedId)) { $soap->sourcedIdSet->sourcedId = array($soap->sourcedIdSet->sourcedId); } foreach ($soap->sourcedIdSet->sourcedId as $id) { $classids[] = $id; } } $tiiClass->setClassIds($classids); $response->setClass($tiiClass); } return $response; } catch (SoapFault $e) { throw new TurnitinSDKException($e->faultcode, $e->faultstring, parent::getLogPath()); } }