Example #1
0
 /**
  *
  * {@inheritdoc}
  * @return DomainProfile
  */
 public function extract()
 {
     $entity = $this->doc->getEntity('profile');
     $builder = new Builder();
     $builder->audience(new Audience($entity->property('audience')->getValue()))->category(new Category($entity->property('category')->getValue()));
     // optional yearwheel property
     if ($entity->hasProperty('yearwheel')) {
         $builder->yearwheel(new Yearwheel($entity->property('yearwheel')->getValue()));
     }
     // optional tags property
     if ($entity->hasProperty('tags')) {
         $builder->tags($entity->property('tags')->getValue());
     }
     return $builder->build();
 }
Example #2
0
 /**
  *
  * @return \Bpi\ApiBundle\Domain\Entity\Profile
  */
 public function createCharlieProfile()
 {
     $builder = new ProfileBuilder();
     return $builder->tags('bravo, alpha, charlie')->build();
 }