/** * {@inheritDoc} */ public function query(Query $query) { $this->assertLoggedIn(); if (!$query instanceof QueryObjectModelInterface) { $parser = new Sql2ToQomQueryConverter($this->factory->get('Query\\QOM\\QueryObjectModelFactory')); try { $qom = $parser->parse($query->getStatement()); $qom->setLimit($query->getLimit()); $qom->setOffset($query->getOffset()); } catch (\Exception $e) { throw new InvalidQueryException('Invalid query: ' . $query->getStatement(), null, $e); } } else { $qom = $query; } $qomWalker = new QOMWalker($this->nodeTypeManager, $this->api, $this->getNamespaces()); list($selectors, $selectorAliases, $query) = $qomWalker->walkQOMQuery($qom); $primarySource = reset($selectors); $primaryType = $primarySource->getSelectorName() ?: $primarySource->getNodeTypeName(); $data = $this->api->forms()->everything->ref($this->ref)->query($query)->submit(); // TODO implement $results = array(); return $results; }
/** * @param Api $api * * @depends testValidApiCall */ public function testForm(Api $api) { $forms = $api->forms(); $this->assertObjectHasAttribute('everything', $forms); // $forms->everything->submit(); }