/** * Returns the whole definition in array form * * @return array Definition */ public function getDefAsArray() { return ['length' => $this->definition->getLength(), 'title' => $this->definition->getTitle(), 'description' => $this->definition->getDescription(), 'exposeAs' => $this->definition->getExposeAs(), 'readOnly' => $this->definition->getReadOnly(), 'required' => $this->definition->getRequired(), 'translatable' => $this->definition->getTranslatable(), 'name' => $this->getName(), 'type' => $this->getType(), 'exposedName' => $this->getExposedName(), 'doctrineType' => $this->getTypeDoctrine(), 'serializerType' => $this->getTypeSerializer(), 'relType' => $this->getRelType(), 'isClassType' => $this->isClassType(), 'constraints' => array_map(function (Schema\Constraint $constraint) { return ['name' => $constraint->getName(), 'options' => array_map(function (Schema\ConstraintOption $option) { return ['name' => $option->getName(), 'value' => $option->getValue()]; }, $constraint->getOptions())]; }, $this->getConstraints())]; }