| @@ 53-60 (lines=8) @@ | ||
| 50 | /** |
|
| 51 | * {@inheritDoc} |
|
| 52 | */ |
|
| 53 | public function createOrUpdateDocument(AgentProfileDocument $document) |
|
| 54 | { |
|
| 55 | $profile = $document->getAgentProfile(); |
|
| 56 | $this->doStoreDocument('post', 'agents/profile', array( |
|
| 57 | 'agent' => $this->actorSerializer->serializeActor($profile->getAgent()), |
|
| 58 | 'profileId' => $profile->getProfileId(), |
|
| 59 | ), $document); |
|
| 60 | } |
|
| 61 | ||
| 62 | /** |
|
| 63 | * {@inheritDoc} |
|
| @@ 65-72 (lines=8) @@ | ||
| 62 | /** |
|
| 63 | * {@inheritDoc} |
|
| 64 | */ |
|
| 65 | public function createOrReplaceDocument(AgentProfileDocument $document) |
|
| 66 | { |
|
| 67 | $profile = $document->getAgentProfile(); |
|
| 68 | $this->doStoreDocument('put', 'agents/profile', array( |
|
| 69 | 'agent' => $this->actorSerializer->serializeActor($profile->getAgent()), |
|
| 70 | 'profileId' => $profile->getProfileId(), |
|
| 71 | ), $document); |
|
| 72 | } |
|
| 73 | ||
| 74 | /** |
|
| 75 | * {@inheritDoc} |
|
| @@ 88-97 (lines=10) @@ | ||
| 85 | /** |
|
| 86 | * {@inheritDoc} |
|
| 87 | */ |
|
| 88 | public function getDocument(AgentProfile $profile) |
|
| 89 | { |
|
| 90 | /** @var \Xabbuh\XApi\Model\DocumentData $documentData */ |
|
| 91 | $documentData = $this->doGetDocument('agents/profile', array( |
|
| 92 | 'agent' => $this->actorSerializer->serializeActor($profile->getAgent()), |
|
| 93 | 'profileId' => $profile->getProfileId(), |
|
| 94 | )); |
|
| 95 | ||
| 96 | return new AgentProfileDocument($profile, $documentData); |
|
| 97 | } |
|
| 98 | } |
|
| 99 | ||