correctly handle byUser
This commit is contained in:
parent
857e98139c
commit
8ab7341dc6
2 changed files with 15 additions and 5 deletions
|
@ -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'),
|
||||
];
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -188,4 +188,9 @@ class User implements UserInterface
|
|||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return (string) $this->getUsername();
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue