Ejemplo n.º 1
0
 /**
  * @param string       $name       Field name
  * @param Schema\Field $definition Field
  *
  * @return JsonDefinitionField
  */
 private function processSimpleField($name, Schema\Field $definition)
 {
     $field = new JsonDefinitionField($name, $definition);
     $relations = $this->getRelations();
     if (isset($relations[$definition->getName()]) && $relations[$definition->getName()]->getType() === DefinitionElementInterface::REL_TYPE_EMBED) {
         $field->setRelType(DefinitionElementInterface::REL_TYPE_EMBED);
     }
     return $field;
 }
Ejemplo n.º 2
0
 /**
  * Gets the name this field should be exposed as (serializer concern).
  * Normally this is the name, but can be overriden by "exposeAs" property on the field.
  *
  * @return string exposed field name
  */
 public function getExposedName()
 {
     return $this->definition->getExposeAs() === null ? $this->definition->getName() : $this->definition->getExposeAs();
 }