コード例 #1
0
ファイル: Profile.php プロジェクト: rimi-itk/bpi-web-service
 /**
  * {@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())));
     }
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  *
  * @param string $id
  */
 public function find($id)
 {
     return $this->list->get($id);
 }