开发者

Problems with Doctrine 2.0

1-) In old version i use syncronizeWithArray method of Doctrine_Record, it's save a lote of time.

Version 2.0 does not provide it?

2-) In code below flush command generate 3 records on database, its a bug of 2.0?

public function indexAction()
{

   $em = $this->getInvokeArg('bootstrap')->em

   $obj = new Entity\Obj();
   $obj->name = "teste";
   $obj->last_name = "teste";
   $em->persist($obj);
   $em->flush();
}

Obs: The indexAction is called onlyOneT开发者_C百科ime.

Problem 2 Solved. its my fault!!


In version 2 doctrine entities don't extend from a base class anymore. Therefore the functionaly synchronizeWithArray isn't in the model anymore.

You could however implement ArrayAcces to work with Entities as if with arrays. See implementing array access in the reference.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜