예제 #1
0
 public function queryIds(AbstractQuery $query, $parent = null)
 {
     $xpath = $parent . $query->getXPath();
     $ids = [];
     foreach ($this->query($xpath) as $index => $element) {
         $ids[] = "({$xpath})[" . ($index + 1) . "]";
     }
     return $query->getFilters()->matchAll($this, $ids);
 }
예제 #2
0
 /**
  * @param  Query\AbstractQuery $query
  * @param  string              $parentId
  * @return array
  */
 public function getChildElementIds(Query\AbstractQuery $query, $parentId)
 {
     $data = ['using' => 'xpath', 'value' => '.' . $query->getXPath()];
     $response = $this->client->request('post', "element/{$parentId}/elements", ['body' => json_encode($data)]);
     $elements = $this->getJson($response);
     return array_map([$this, 'convertElement'], $elements);
 }
예제 #3
0
 /**
  * @param  Query\AbstractQuery $query
  * @param  string              $parentId
  * @return array
  */
 public function getChildElementIds(Query\AbstractQuery $query, $parentId)
 {
     return $this->jsonResponse($this->client->request('post', "element/{$parentId}/elements", ['form_params' => ['value' => '.' . $query->getXPath()]]));
 }