예제 #1
0
 /**
  * {@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);
 }
예제 #2
0
 /**
  * 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);
 }
예제 #3
0
 /**
  * {@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);
 }