EasyAdmin! For an Awesomely Powerful Admin Area
Auto-complete Association Field & Controlling the Query
  Start your All-Access Pass to unlock this challenge
Buy Access Login

Challenge 1 / 1

Suppose we have the following field:

yield AssociationField::new('topic')
    ->setFormTypeOption('choice_label', 'name')
    ->formatValue(function($value, Topic $topic) {
        return 'Topic: '.$topic->getName();
    });

Also, the __toString() method in Topic looks like this:

public function __toString(): string
{
    return 'Topic name: '.$this->name;
}

Assuming that a Question is related to a Topic whose name is "Cake", which of the following is true about how the topic field will be rendered?

Skip challenges and go to theNext Chapter

Turn Challenges Off?

All further challenges will be skipped automatically.
You can re-enable challenges at any time on this page or from your account page.