Code Duplication    Length = 12-12 lines in 2 locations

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

@@ 800-811 (lines=12) @@
797
     *
798
     * @return \eZ\Publish\API\Repository\Values\Content\LocationCreateStruct
799
     */
800
    public function newLocationCreateStruct($parentLocationId, ContentType $contentType = null)
801
    {
802
        $properties = [
803
            'parentLocationId' => $parentLocationId,
804
        ];
805
        if ($contentType) {
806
            $properties['sortField'] = $contentType->defaultSortField;
807
            $properties['sortOrder'] = $contentType->defaultSortOrder;
808
        }
809
810
        return new LocationCreateStruct($properties);
811
    }
812
813
    /**
814
     * Instantiates a new location update class.

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

@@ 78-89 (lines=12) @@
75
     *
76
     * @return \eZ\Publish\API\Repository\Values\Content\LocationCreateStruct
77
     */
78
    public function newLocationCreateStruct($parentLocationId, ContentType $contentType = null)
79
    {
80
        $properties = [
81
            'parentLocationId' => $parentLocationId,
82
        ];
83
        if ($contentType) {
84
            $properties['sortField'] = $contentType->defaultSortField;
85
            $properties['sortOrder'] = $contentType->defaultSortOrder;
86
        }
87
88
        return new LocationCreateStruct($properties);
89
    }
90
91
    /**
92
     * Creates the new $location in the content repository for the given content.