| @@ 87-98 (lines=12) @@ | ||
| 84 | * |
|
| 85 | * @return \eZ\Publish\API\Repository\Values\Content\LocationCreateStruct |
|
| 86 | */ |
|
| 87 | public function newLocationCreateStruct($parentLocationId, ContentType $contentType = null) |
|
| 88 | { |
|
| 89 | $properties = [ |
|
| 90 | 'parentLocationId' => $parentLocationId, |
|
| 91 | ]; |
|
| 92 | if ($contentType) { |
|
| 93 | $properties['sortField'] = $contentType->defaultSortField; |
|
| 94 | $properties['sortOrder'] = $contentType->defaultSortOrder; |
|
| 95 | } |
|
| 96 | ||
| 97 | return new LocationCreateStruct($properties); |
|
| 98 | } |
|
| 99 | ||
| 100 | /** |
|
| 101 | * Creates the new $location in the content repository for the given content. |
|
| @@ 731-742 (lines=12) @@ | ||
| 728 | * |
|
| 729 | * @return \eZ\Publish\API\Repository\Values\Content\LocationCreateStruct |
|
| 730 | */ |
|
| 731 | public function newLocationCreateStruct($parentLocationId, ContentType $contentType = null) |
|
| 732 | { |
|
| 733 | $properties = [ |
|
| 734 | 'parentLocationId' => $parentLocationId, |
|
| 735 | ]; |
|
| 736 | if ($contentType) { |
|
| 737 | $properties['sortField'] = $contentType->defaultSortField; |
|
| 738 | $properties['sortOrder'] = $contentType->defaultSortOrder; |
|
| 739 | } |
|
| 740 | ||
| 741 | return new LocationCreateStruct($properties); |
|
| 742 | } |
|
| 743 | ||
| 744 | /** |
|
| 745 | * Instantiates a new location update class. |
|