-
Notifications
You must be signed in to change notification settings - Fork 54
Implemented skip in findBy method in Repository class #157
base: master
Are you sure you want to change the base?
Conversation
Hi tomcyr, what about adding a test for this PR? |
Hi @odino, |
great, thanks! |
tomcyr@dcddc4a - http status 100 we have as response when updating documents |
@odino you should receive 200 if ok |
@tomcyr is there any way we can reproduce why we're getting |
OK, let's say we have example test records in db from this example: #158 Next in my action: /**
* @Route("/api/test")
*/
public function indexAction()
{
$manager = $this->container->get('odm');
$tests = $manager->getRepository('\ConceptIt\SmartShopperBundle\Entity\Test')->findBy(array(), array(), 10);
foreach($tests as $key => $test){
$test->setName('aaa'.$key);
$manager->persist($test);
}
} And then I receive HTTP STATUS 100 and response text 'Record '#14:0' updated successful'. |
OK, I know now but it's very strange: Record #12:1 updated successfully. so I dump before Exception InvalidQueryException, in code: public function getData()
{
if (!$this->isValid()) {
var_dump($this->response->getStatusCode());
throw new InvalidQueryException($this->response->getBody(), $this);
}
$body = $this->response->getBody();
if (null === $json = json_decode($body)) {
if ($this->isValidRid($body)) {
return $body;
} elseif ($body === "") {
return true;
}
throw new \RuntimeException("Invalid JSON payload");
}
return $json;
} and in dump i have 100 !!! |
There is another problem yet. If we're updating document in Orient DB which has @Version > 0 we must send our @Version in request. We have @Version of document in response when we're getting it from db but we must have it in our object. So the simplest way is to add property version with name @Version in annotation in every Entity class. But I'm wonder if there is any better place for it?? |
hey @tomcyr, any news on this? |
hey @odino, because nothing happened with orientdb-odm last few months I used mongo :( |
ok, no worries :) |
There was $offset argument but it was nothing meaning for query:)