/** * {@inheritDoc} */ public function getStatements(StatementsFilter $filter = null) { $urlParameters = array(); if (null !== $filter) { $urlParameters = $filter->getFilter(); } // the Agent must be JSON encoded if (isset($urlParameters['agent'])) { $urlParameters['agent'] = $this->actorSerializer->serializeActor($urlParameters['agent']); } return $this->doGetStatements('statements', $urlParameters); }
/** * Stores a state document. * * @param string $method HTTP method to use * @param StateDocument $document The document to store */ private function doStoreStateDocument($method, StateDocument $document) { $state = $document->getState(); $this->doStoreDocument($method, 'activities/state', array('activityId' => $state->getActivity()->getId()->getValue(), 'agent' => $this->actorSerializer->serializeActor($state->getActor()), 'stateId' => $state->getStateId()), $document); }
/** * {@inheritDoc} */ public function getDocument(AgentProfile $profile) { /** @var \Xabbuh\XApi\Model\DocumentData $documentData */ $documentData = $this->doGetDocument('agents/profile', array('agent' => $this->actorSerializer->serializeActor($profile->getAgent()), 'profileId' => $profile->getProfileId())); return new AgentProfileDocument($profile, $documentData); }