getClassTypeHint example


        $nullable = '|null';
        if ($field->is(Required::class)) {
            $nullable = '';
        }

        $uses = [];

        switch (true) {
            case $field instanceof ParentAssociationField:
                $uses[] = $this->getUsage($definition->getEntityClass());
                $type = $this->getClassTypeHint($definition->getEntityClass());

                break;
            case $field instanceof ChildrenAssociationField:
                $uses[] = $this->getUsage($definition->getCollectionClass());
                $type = $this->getClassTypeHint($definition->getCollectionClass());

                break;
            case $field instanceof OneToOneAssociationField:
            case $field instanceof ManyToOneAssociationField:
                $uses[] = $this->getUsage($field->getReferenceDefinition()->getEntityClass());
                $type = $this->getClassTypeHint($field->getReferenceDefinition()->getEntityClass());

                
Home | Imprint | This part of the site doesn't use cookies.