Closed langziyang closed 3 years ago
Hi, I'm going through old opended issues and PRs to cleanup too-long-opened items and close them. Thank you for your contribution and time.
We needs a feature with test and passing CI to be able to merge it without letting a bug in. If this is still relevant for you, please add code with test and make CI pass first. Then we'll able to merge your feature without further waiting :+1:
Thank for understanding.
i use easyadmin 3 and knp.i have Category.php and CategoryTranslation.php.now when i configureFields on easyadmin controller how can get all parent category?
`<?php
namespace App\Entity;
use App\Repository\CategoryRepository; use Doctrine\ORM\Mapping as ORM; use Knp\DoctrineBehaviors\Contract\Entity\TranslatableInterface; use Knp\DoctrineBehaviors\Contract\Entity\TreeNodeInterface; use Knp\DoctrineBehaviors\Model\Translatable\TranslatableTrait; use Knp\DoctrineBehaviors\Model\Tree\TreeNodeTrait;
/**
@ORM\Entity(repositoryClass=CategoryRepository::class) */ class Category implements TranslatableInterface, TreeNodeInterface { use TranslatableTrait; use TreeNodeTrait;
/**
public function getId(): ?int { return $this->id; }
public function getParentNode(): ?TreeNodeInterface { }
public function getRootNode(): TreeNodeInterface { }
public function __toString(): string { // i want return the name eq locale parameters from services.yaml.how get it? } }
<?php
namespace App\Entity;
use App\Repository\CategoryTranslationRepository; use Doctrine\ORM\Mapping as ORM; use Knp\DoctrineBehaviors\Contract\Entity\TranslationInterface; use Knp\DoctrineBehaviors\Model\Translatable\TranslationTrait;
/**
@ORM\Entity(repositoryClass=CategoryTranslationRepository::class) */ class CategoryTranslation implements TranslationInterface { use TranslationTrait;
/**
/**
public function getId(): ?int { return $this->id; }
public function getName(): ?string { return $this->name; }
public function setName(string $name): self { $this->name = $name;
} } `
`<?php
namespace App\Controller\Admin;
use App\Entity\Category; use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController; use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField; use EasyCorp\Bundle\EasyAdminBundle\Field\IdField;
class CategoryCrudController extends AbstractCrudController { public static function getEntityFqcn(): string { return Category::class; }
} `