public function findAssignments($assignment) { try { $soap = $this->readLineItemIdsForCourseSection(array('sectionSourcedId' => $assignment->getClassId())); $response = new Response($this); if ($response->getStatus() == 'error') { throw new TurnitinSDKException($response->getStatusCode(), $response->getDescription()); } else { $tiiAssignment = new TiiAssignment(); $assignmentids = 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) { $assignmentids[] = $id; } } $tiiAssignment->setAssignmentIds($assignmentids); $response->setAssignment($tiiAssignment); } return $response; } catch (SoapFault $e) { throw new TurnitinSDKException($e->faultcode, $e->faultstring, parent::getLogPath()); } }