66
77use CodeRhapsodie \EzDataflowBundle \Exception \InvalidArgumentTypeException ;
88use eZ \Publish \API \Repository \Values \Content \Location ;
9+ use eZ \Publish \API \Repository \Values \Content \LocationCreateStruct ;
910
1011class ContentCreateStructure extends ContentStructure
1112{
@@ -24,6 +25,7 @@ class ContentCreateStructure extends ContentStructure
2425 * <li>an integer, the id of the Location object</li>
2526 * <li>a string, the remote id of the Location object</li>
2627 * <li>a Location object</li>
28+ * <li>a LocationCreateStruct object</li>
2729 * </ul>
2830 *
2931 * @throws InvalidArgumentTypeException
@@ -52,12 +54,13 @@ public function getLocations(): array
5254 */
5355 private function setLocations (array $ locations )
5456 {
55- foreach ($ locations as $ locationOrIdOrRemoteId ) {
56- if (!is_int ($ locationOrIdOrRemoteId )
57- && !is_string ($ locationOrIdOrRemoteId )
58- && !$ locationOrIdOrRemoteId instanceof Location
57+ foreach ($ locations as $ locationOrIdOrRemoteIdOrStruct ) {
58+ if (!is_int ($ locationOrIdOrRemoteIdOrStruct )
59+ && !is_string ($ locationOrIdOrRemoteIdOrStruct )
60+ && !$ locationOrIdOrRemoteIdOrStruct instanceof Location
61+ && !$ locationOrIdOrRemoteIdOrStruct instanceof LocationCreateStruct
5962 ) {
60- throw InvalidArgumentTypeException::create (['int ' , 'string ' , Location::class], $ locationOrIdOrRemoteId );
63+ throw InvalidArgumentTypeException::create (['int ' , 'string ' , Location::class, LocationCreateStruct::class ], $ locationOrIdOrRemoteIdOrStruct );
6164 }
6265 }
6366
0 commit comments