Code Duplication    Length = 12-12 lines in 2 locations

eZ/Publish/Core/Repository/LocationService.php 1 location

@@ 759-770 (lines=12) @@
756
     *
757
     * @return \eZ\Publish\API\Repository\Values\Content\LocationCreateStruct
758
     */
759
    public function newLocationCreateStruct($parentLocationId, ContentType $contentType = null)
760
    {
761
        $properties = [
762
            'parentLocationId' => $parentLocationId,
763
        ];
764
        if ($contentType) {
765
            $properties['sortField'] = $contentType->defaultSortField;
766
            $properties['sortOrder'] = $contentType->defaultSortOrder;
767
        }
768
769
        return new LocationCreateStruct($properties);
770
    }
771
772
    /**
773
     * Instantiates a new location update class.

eZ/Publish/Core/REST/Client/LocationService.php 1 location

@@ 88-99 (lines=12) @@
85
     *
86
     * @return \eZ\Publish\API\Repository\Values\Content\LocationCreateStruct
87
     */
88
    public function newLocationCreateStruct($parentLocationId, ContentType $contentType = null)
89
    {
90
        $properties = [
91
            'parentLocationId' => $parentLocationId,
92
        ];
93
        if ($contentType) {
94
            $properties['sortField'] = $contentType->defaultSortField;
95
            $properties['sortOrder'] = $contentType->defaultSortOrder;
96
        }
97
98
        return new LocationCreateStruct($properties);
99
    }
100
101
    /**
102
     * Creates the new $location in the content repository for the given content.