/**
  * {@inheritdoc}
  */
 public function offsetGet($offset)
 {
     if (!$this->offsetExists($offset)) {
         throw new \InvalidArgumentException('Undefined Offset ' . $offset);
     }
     if (array_key_exists($offset, $this->loaded)) {
         return $this->loaded[$offset];
     }
     $this->loaded[$offset] = $this->factory->load($this->relations[$offset]->getRight());
     return $this->loaded[$offset];
 }
Exemplo n.º 2
0
 /**
  * @return \Vesax\RelationBundle\Entity\Link
  */
 protected function getUserLink()
 {
     return $this->linkFactory->link($this->getUser(), $this->userLoader);
 }