예제 #1
0
파일: Session.php 프로젝트: harp-orm/harp
 /**
  * @return DB
  */
 public function add(AbstractModel $model)
 {
     if ($this->identityMap->hasIdentityKey($model)) {
         $model = $this->identityMap->get($model);
     } else {
         $this->new->attach($model);
     }
     $this->attach($model);
     return $this;
 }
예제 #2
0
 /**
  * @covers            IdentityMap::getId
  * @depends           testObjectCanBeAdded
  * @expectedException OutOfBoundsException
  */
 public function testExceptionIsRaisedForNonExistantObject(IdentityMap $map)
 {
     $map->getId(new StdClass());
 }
예제 #3
0
파일: DbRepository.php 프로젝트: t4web/base
 protected function toIdentityMap(EntityInterface $entity)
 {
     $this->getIdentityMap()->offsetSet($entity->getId(), $entity);
     $this->identityMapOriginal->offsetSet($entity->getId(), clone $entity);
 }