File tree Expand file tree Collapse file tree 5 files changed +64
-0
lines changed 
lib/Server/Input/Parser/Criterion/Location Expand file tree Collapse file tree 5 files changed +64
-0
lines changed Original file line number Diff line number Diff line change @@ -296,6 +296,11 @@ services:
296296        tags :
297297            - { name: ibexa.rest.input.parser, mediaType: application/vnd.ibexa.api.internal.criterion.LocationDepth } 
298298
299+     Ibexa\Rest\Server\Input\Parser\Criterion\Location\IsMainLocation :
300+         parent : Ibexa\Rest\Server\Common\Parser 
301+         tags :
302+             - { name: ibexa.rest.input.parser, mediaType: application/vnd.ibexa.api.internal.criterion.IsMainLocation } 
303+ 
299304    Ibexa\Rest\Server\Input\Parser\Criterion\Ancestor :
300305        parent : Ibexa\Rest\Server\Common\Parser 
301306        class : Ibexa\Rest\Server\Input\Parser\Criterion\Ancestor 
Original file line number Diff line number Diff line change 1+ <?php 
2+ 
3+ /** 
4+  * @copyright Copyright (C) Ibexa AS. All rights reserved. 
5+  * @license For full copyright and license information view LICENSE file distributed with this source code. 
6+  */ 
7+ declare (strict_types=1 );
8+ 
9+ namespace  Ibexa \Rest \Server \Input \Parser \Criterion \Location ;
10+ 
11+ use  Ibexa \Contracts \Core \Repository \Values \Content \Query \Criterion \Location \IsMainLocation  as  IsMainLocationCriterion ;
12+ use  Ibexa \Contracts \Rest \Exceptions ;
13+ use  Ibexa \Contracts \Rest \Input \ParsingDispatcher ;
14+ use  Ibexa \Rest \Input \BaseParser ;
15+ 
16+ final  class  IsMainLocation extends  BaseParser
17+ {
18+     public  function  parse (array  $ dataParsingDispatcher $ parsingDispatcherIsMainLocationCriterion 
19+     {
20+         if  (!array_key_exists ('IsMainLocation ' , $ data
21+             throw  new  Exceptions \Parser ('Invalid <IsMainLocation> format ' );
22+         }
23+ 
24+         return  new  IsMainLocationCriterion ($ data'IsMainLocation ' ]);
25+     }
26+ }
Original file line number Diff line number Diff line change @@ -101,6 +101,16 @@ public function provideForViewTest(): iterable
101101            file_get_contents (__DIR__  . '/_input/search/LocationDepth.in.json ' ),
102102            'json ' ,
103103        ];
104+ 
105+         yield  $ template'IsMainLocation ' , 'eq ' , 'xml ' ) => [
106+             file_get_contents (__DIR__  . '/_input/search/IsMainLocation.xml ' ),
107+             'xml ' ,
108+         ];
109+ 
110+         yield  $ template'IsMainLocation ' , 'eq ' , 'json ' ) => [
111+             file_get_contents (__DIR__  . '/_input/search/IsMainLocation.json ' ),
112+             'json ' ,
113+         ];
104114    }
105115
106116    /** 
Original file line number Diff line number Diff line change 1+ {
2+   "ViewInput" : {
3+     "identifier" : " TitleView" 
4+     "Query" : {
5+       "LocationFilter" : {
6+         "IsMainLocation" : 1 
7+       },
8+       "limit" : 10 ,
9+       "offset" : 0 
10+     }
11+   }
12+ }
Original file line number Diff line number Diff line change 1+ <?xml  version =" 1.0"  encoding =" UTF-8" 
2+ <ViewInput >
3+     <identifier >TitleView</identifier >
4+     <Query >
5+         <LocationFilter >
6+             <IsMainLocation >1</IsMainLocation >
7+         </LocationFilter >
8+         <limit >10</limit >
9+         <offset >0</offset >
10+     </Query >
11+ </ViewInput >
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments