-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add a yaml example for specifying an identifier. #640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Actually, I don't think this is correct. I still get the warning |
Do you have a getter on your property and enable the get on item operation ? |
Yes. final class MyNonDoctrineModel
{
/**
* @var string
*/
private $id;
/**
* @var Organisation
*/
private $organisation;
/**
* @var Template
*/
private $template;
/**
* @var float
*/
private $price;
public function __construct(Organisation $organisation, Template $template)
{
$this->organisation = $organisation;
$this->template = $template;
$this->id = $this->organisation->getId().'-'.$this->template->getId();
}
public function getId(): string
{
return $this->id;
} |
My resource looks like this App\Api\Model\MyNonDoctrineModel:
properties:
identifier: [id]
attributes:
access_control: "is_granted('ROLE_USER')"
itemOperations:
get:
method: GET
path: /organisations-templates/{id}
defaults:
_api_receive: false
controller: App\Api\Action\OrganisationTemplatePrice\ViewAction
collectionOperations:
get:
method: GET
path: /organisations-templates
controller: App\Api\Action\OrganisationTemplatePrice\ListAction It's definitely a configuration issue with defining the identifiers because what I have configured are not coming through when I do a dump within IdentifiersExtractor.php If I override the array of identifiers within that code it works. |
isn't that
instead ? |
I'm away from my computer at the moment. But I am pretty sure I tried that
and it didn't work either.
|
You were right @antograssiot. Thanks! |
Thanks a lot @trsteel88 and @antograssiot, this kind of enhancements in the docs are very helpful! |
You're welcome! |
Closes #639