outline-8.x-1.x-dev/modules/outline_graphql/src/Plugin/GraphQL/DataProducer/Entry/ReferencedEntityEditFormUrl.php
modules/outline_graphql/src/Plugin/GraphQL/DataProducer/Entry/ReferencedEntityEditFormUrl.php
<?php
namespace Drupal\outline_graphql\Plugin\GraphQL\DataProducer\Entry;
use Drupal\Core\Entity\EntityInterface;
use Drupal\graphql\Plugin\GraphQL\DataProducer\DataProducerPluginBase;
/**
* @DataProducer(
* id = "referenced_entity_edit_form_url",
* name = @Translation("Referenced Entity Edit Form URL"),
* description = @Translation("Returns the referenced entity's edit form URL."),
* produces = @ContextDefinition("string",
* label = @Translation("Referenced Entity Edit Form URL")
* ),
* consumes = {
* "entity" = @ContextDefinition("entity",
* label = @Translation("Entity")
* )
* }
* )
*/
class ReferencedEntityEditFormUrl extends DataProducerPluginBase {
/**
* @param \Drupal\Core\Entity\EntityInterface $entity
*
* @return string
*/
public function resolve(EntityInterface $entity) {
return $entity->getReferencedEntityEditFormUrl();
}
}
