| @@ 587-599 (lines=13) @@ | ||
| 584 | * |
|
| 585 | * @return \eZ\Publish\API\Repository\Values\ContentType\ContentType |
|
| 586 | */ |
|
| 587 | public function loadContentTypeByIdentifier($identifier) |
|
| 588 | { |
|
| 589 | $response = $this->client->request( |
|
| 590 | 'GET', |
|
| 591 | $this->requestParser->generate('typeByIdentifier', array('type' => $identifier)), |
|
| 592 | new Message( |
|
| 593 | array('Accept' => $this->outputVisitor->getMediaType('ContentTypeList')) |
|
| 594 | ) |
|
| 595 | ); |
|
| 596 | $contentTypes = $this->inputDispatcher->parse($response); |
|
| 597 | ||
| 598 | return $this->completeContentType(reset($contentTypes)); |
|
| 599 | } |
|
| 600 | ||
| 601 | /** |
|
| 602 | * Get a Content Type object by id. |
|
| @@ 610-622 (lines=13) @@ | ||
| 607 | * |
|
| 608 | * @return \eZ\Publish\API\Repository\Values\ContentType\ContentType |
|
| 609 | */ |
|
| 610 | public function loadContentTypeByRemoteId($remoteId) |
|
| 611 | { |
|
| 612 | $response = $this->client->request( |
|
| 613 | 'GET', |
|
| 614 | $this->requestParser->generate('typeByRemoteId', array('type' => $remoteId)), |
|
| 615 | new Message( |
|
| 616 | array('Accept' => $this->outputVisitor->getMediaType('ContentTypeList')) |
|
| 617 | ) |
|
| 618 | ); |
|
| 619 | $contentTypes = $this->inputDispatcher->parse($response); |
|
| 620 | ||
| 621 | return reset($contentTypes); |
|
| 622 | } |
|
| 623 | ||
| 624 | /** |
|
| 625 | * Get Content Type objects which belong to the given content type group. |
|
| @@ 541-554 (lines=14) @@ | ||
| 538 | * |
|
| 539 | * @return \eZ\Publish\API\Repository\Values\User\Role |
|
| 540 | */ |
|
| 541 | public function loadRoleByIdentifier($name) |
|
| 542 | { |
|
| 543 | $response = $this->client->request( |
|
| 544 | 'GET', |
|
| 545 | $this->requestParser->generate('roleByIdentifier', array('role' => $name)), |
|
| 546 | new Message( |
|
| 547 | array('Accept' => $this->outputVisitor->getMediaType('RoleList')) |
|
| 548 | ) |
|
| 549 | ); |
|
| 550 | ||
| 551 | $result = $this->inputDispatcher->parse($response); |
|
| 552 | ||
| 553 | return reset($result); |
|
| 554 | } |
|
| 555 | ||
| 556 | /** |
|
| 557 | * Loads all roles. |
|
| @@ 611-623 (lines=13) @@ | ||
| 608 | * |
|
| 609 | * @return \eZ\Publish\API\Repository\Values\User\Policy[] |
|
| 610 | */ |
|
| 611 | public function loadPoliciesByUserId($userId) |
|
| 612 | { |
|
| 613 | $values = $this->requestParser->parse('user', $userId); |
|
| 614 | $response = $this->client->request( |
|
| 615 | 'GET', |
|
| 616 | $this->requestParser->generate('userPolicies', array('user' => $values['user'])), |
|
| 617 | new Message( |
|
| 618 | array('Accept' => $this->outputVisitor->getMediaType('PolicyList')) |
|
| 619 | ) |
|
| 620 | ); |
|
| 621 | ||
| 622 | return $this->inputDispatcher->parse($response); |
|
| 623 | } |
|
| 624 | ||
| 625 | /** |
|
| 626 | * Assigns a role to the given user group. |
|
| @@ 198-210 (lines=13) @@ | ||
| 195 | * |
|
| 196 | * @return \eZ\Publish\API\Repository\Values\Content\Section |
|
| 197 | */ |
|
| 198 | public function loadSectionByIdentifier($sectionIdentifier) |
|
| 199 | { |
|
| 200 | $response = $this->client->request( |
|
| 201 | 'GET', |
|
| 202 | $this->requestParser->generate('sectionByIdentifier', array('section' => $sectionIdentifier)), |
|
| 203 | new Message( |
|
| 204 | array('Accept' => $this->outputVisitor->getMediaType('SectionList')) |
|
| 205 | ) |
|
| 206 | ); |
|
| 207 | $result = $this->inputDispatcher->parse($response); |
|
| 208 | ||
| 209 | return reset($result); |
|
| 210 | } |
|
| 211 | ||
| 212 | /** |
|
| 213 | * Counts the contents which $section is assigned to. |
|