add taxonomy field
This commit is contained in:
parent
61911396ea
commit
5bc4992a61
@ -34,7 +34,7 @@ echo -e " 🍓 Found module ${B}endpoint_get_${NODE}${E}"
|
||||
../vendor/drush/drush/drush pml --fields=name,status > /tmp/.drush.pml
|
||||
cat /tmp/.drush.pml | grep -e "Enabled" | grep "endpoint_get_${NODE}"
|
||||
if [ $? -eq 0 ];then
|
||||
echo -n "\n 🍓 Disabling module ${B}endpoint_get_${NODE}${E}"
|
||||
echo -en "\n 🍓 Disabling module ${B}endpoint_get_${NODE}${E}"
|
||||
../vendor/drush/drush/drush pmu "endpoint_get_${NODE}"
|
||||
fi
|
||||
|
||||
|
||||
@ -102,7 +102,7 @@ class NodeController extends ControllerBase implements ContainerInjectionInterfa
|
||||
$this->response = [
|
||||
'code' => $this->statusCode,
|
||||
'alias' => '/AAAAA/'.$alias,
|
||||
'nid' => $nid,
|
||||
'nid' => intval($nid),
|
||||
'author' => $name,
|
||||
'title' => $node->get('title')->value,
|
||||
// AUTO_ADD_CODE_BELLOW_response
|
||||
|
||||
16
endpoints/endpoint_get_fields/entity_reference-extractor
Normal file
16
endpoints/endpoint_get_fields/entity_reference-extractor
Normal file
@ -0,0 +1,16 @@
|
||||
$category_id = (
|
||||
$node
|
||||
->get(self::FIELD_CATEGORY)
|
||||
->entity) ? intval(\\Drupal::service('entity.repository')
|
||||
->getTranslationFromContext(
|
||||
$node->get(self::FIELD_CATEGORY)->entity,
|
||||
$node->currentTranslation
|
||||
)->id()) : null;
|
||||
$category_label = (
|
||||
$node
|
||||
->get(self::FIELD_CATEGORY)
|
||||
->entity) ? \\Drupal::service('entity.repository')
|
||||
->getTranslationFromContext(
|
||||
$node->get(self::FIELD_CATEGORY)->entity,
|
||||
$node->currentTranslation
|
||||
)->getName() : null;
|
||||
2
endpoints/endpoint_get_fields/entity_reference-response
Normal file
2
endpoints/endpoint_get_fields/entity_reference-response
Normal file
@ -0,0 +1,2 @@
|
||||
'category_id' => $category_id,
|
||||
'category_label' => $category_label,
|
||||
Loading…
x
Reference in New Issue
Block a user