예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function transform(Document $document)
 {
     try {
         $entity = $document->currentEntity();
     } catch (\RuntimeException $e) {
         $entity = $document->createEntity('entity', 'profile');
         $document->appendEntity($entity);
     }
     if ($this->yearwheel instanceof Yearwheel) {
         $entity->addProperty($document->createProperty('yearwheel', 'string', $this->yearwheel->name()));
     }
     if ($this->tags && $this->tags->count()) {
         $entity->addProperty($document->createProperty('tags', 'string', implode(', ', $this->tags->toArray())));
     }
 }
 /**
  * {@inheritdoc}
  *
  * @param string $id
  */
 public function find($id)
 {
     return $this->list->get($id);
 }