correctly handle byUser

This commit is contained in:
jannisp 2021-04-26 17:05:38 +02:00
parent 857e98139c
commit 8ab7341dc6
2 changed files with 15 additions and 5 deletions

View file

@ -3,7 +3,13 @@
namespace App\Controller\Admin;
use App\Entity\Offering;
use App\Entity\User;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField;
use EasyCorp\Bundle\EasyAdminBundle\Field\IdField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
use EasyCorp\Bundle\EasyAdminBundle\Field\DateTimeField;
class OfferingCrudController extends AbstractCrudController
{
@ -12,14 +18,13 @@ class OfferingCrudController extends AbstractCrudController
return Offering::class;
}
/*
public function configureFields(string $pageName): iterable
{
return [
IdField::new('id'),
TextField::new('title'),
TextEditorField::new('description'),
yield AssociationField::new('byUser'),
yield TextField::new('title'),
yield DateTimeField::new('createdAt'),
yield TextField::new('photoFilename'),
];
}
*/
}

View file

@ -188,4 +188,9 @@ class User implements UserInterface
return $this;
}
public function __toString(): string
{
return (string) $this->getUsername();
}
}