|
@@ -68,7 +68,7 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase {
|
|
|
//
|
|
|
$this->addImage($registry, $builder);
|
|
|
//
|
|
|
- // $this->addTaxoterm($registry, $builder);
|
|
|
+ $this->addTaxoterm($registry, $builder);
|
|
|
//
|
|
|
$this->addLink($registry, $builder);
|
|
|
|
|
@@ -202,11 +202,30 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase {
|
|
|
$registry->addFieldResolver('Concernement', 'author',
|
|
|
$builder->compose(
|
|
|
$builder->produce('entity_owner')
|
|
|
- ->map('entity', $builder->fromParent()),
|
|
|
- $builder->produce('entity_label')
|
|
|
->map('entity', $builder->fromParent())
|
|
|
));
|
|
|
|
|
|
+ $registry->addFieldResolver('Concernement', 'created',
|
|
|
+ $builder->compose(
|
|
|
+ $builder->produce('entity_created')
|
|
|
+ ->map('entity', $builder->fromParent())
|
|
|
+ )
|
|
|
+ );
|
|
|
+
|
|
|
+ $registry->addFieldResolver('Concernement', 'changed',
|
|
|
+ $builder->compose(
|
|
|
+ $builder->produce('entity_changed')
|
|
|
+ ->map('entity', $builder->fromParent())
|
|
|
+ )
|
|
|
+ );
|
|
|
+
|
|
|
+ $registry->addFieldResolver('Concernement', 'lieu',
|
|
|
+ $builder->produce('entity_reference')
|
|
|
+ ->map('entity', $builder->fromParent())
|
|
|
+ ->map('field', $builder->fromValue('field_lieu'))
|
|
|
+ );
|
|
|
+
|
|
|
+
|
|
|
// $registry->addFieldResolver('Concernement', 'recit',
|
|
|
// $builder->produce('entity_reference')
|
|
|
// ->map('entity', $builder->fromParent())
|
|
@@ -404,8 +423,8 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase {
|
|
|
->map('entity', $builder->fromParent()),
|
|
|
$builder->produce('entity_label')
|
|
|
->map('entity', $builder->fromParent())
|
|
|
- ));
|
|
|
-
|
|
|
+ )
|
|
|
+ );
|
|
|
|
|
|
$registry->addFieldResolver('Entite', 'sources',
|
|
|
$builder->produce('entity_reference_revisions')
|
|
@@ -413,7 +432,6 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase {
|
|
|
->map('field', $builder->fromValue('field_sources'))
|
|
|
);
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
// ____
|
|
@@ -1308,6 +1326,12 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase {
|
|
|
->map('ids', $builder->fromParent())
|
|
|
)
|
|
|
);
|
|
|
+
|
|
|
+ $registry->addFieldResolver('User', 'structure',
|
|
|
+ $builder->produce('entity_reference')
|
|
|
+ ->map('entity', $builder->fromParent())
|
|
|
+ ->map('field', $builder->fromValue('field_strucure'))
|
|
|
+ );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -1461,84 +1485,84 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase {
|
|
|
// | |/ _` / _` |
|
|
|
// |_|\__,_\__, |
|
|
|
// |___/
|
|
|
- // protected function addTaxoterm(ResolverRegistryInterface $registry, ResolverBuilder $builder) {
|
|
|
- // $registry->addFieldResolver('Query', 'alltags',
|
|
|
- // $builder->compose(
|
|
|
- // $builder->callback(function($parent, $arg){
|
|
|
- // $entity_storage = \Drupal::entityTypeManager()->getStorage('taxonomy_term');
|
|
|
- // $query = $entity_storage->getQuery()
|
|
|
- // ->condition('vid', ['tag','tag_prod'], 'IN')
|
|
|
- // ->accessCheck(TRUE);
|
|
|
- // $results = $query->execute();
|
|
|
- // return $results;
|
|
|
- // }),
|
|
|
- // $builder->produce('entity_load_multiple')
|
|
|
- // ->map('type', $builder->fromValue('taxonomy_term'))
|
|
|
- // ->map('ids', $builder->fromParent())
|
|
|
- // )
|
|
|
- // );
|
|
|
-
|
|
|
- // $registry->addFieldResolver('Query', 'tag',
|
|
|
- // $builder->produce('entity_load')
|
|
|
- // ->map('type', $builder->fromValue('taxonomy_term'))
|
|
|
- // ->map('bundles', $builder->fromValue(['tag']))
|
|
|
- // ->map('id', $builder->fromArgument('id'))
|
|
|
- // );
|
|
|
- // $registry->addFieldResolver('Query', 'famille',
|
|
|
- // $builder->produce('entity_load')
|
|
|
- // ->map('type', $builder->fromValue('taxonomy_term'))
|
|
|
- // ->map('bundles', $builder->fromValue(['famille']))
|
|
|
- // ->map('id', $builder->fromArgument('id'))
|
|
|
- // );
|
|
|
- // $registry->addFieldResolver('Query', 'tagprod',
|
|
|
- // $builder->produce('entity_load')
|
|
|
- // ->map('type', $builder->fromValue('taxonomy_term'))
|
|
|
- // ->map('bundles', $builder->fromValue(['tag_prod']))
|
|
|
- // ->map('id', $builder->fromArgument('id'))
|
|
|
- // );
|
|
|
-
|
|
|
- // // get all tags for a given familly
|
|
|
- // // $registry->addFieldResolver('Query', 'famillytags',
|
|
|
- // // $builder->compose(
|
|
|
- // // $builder->callback(function($parent, $arg){
|
|
|
- // // $entity_storage = \Drupal::entityTypeManager()->getStorage('node');
|
|
|
- // // $query = $entity_storage->getQuery()
|
|
|
- // // ->condition('type', ['texte', 'texte_prod'], 'IN')
|
|
|
- // // ->condition('field_famille', $arg->famillyid)
|
|
|
- // // ->accessCheck(TRUE);
|
|
|
- // // $results = $query->execute();
|
|
|
- // // return $results;
|
|
|
- // // }),
|
|
|
- // // $builder->produce('entity_load_multiple')
|
|
|
- // // ->map('type', $builder->fromValue('node'))
|
|
|
- // // ->map('ids', $builder->fromParent())
|
|
|
- // // // $builder->produce('entity_load_multiple')
|
|
|
- // // // ->map('type', $builder->fromValue('taxonomy_term'))
|
|
|
- // // // ->map('ids', $builder->fromParent())
|
|
|
- // // )
|
|
|
- // // );
|
|
|
-
|
|
|
-
|
|
|
- // $registry->addFieldResolver('Taxoterm', 'id',
|
|
|
- // $builder->produce('entity_id')
|
|
|
- // ->map('entity', $builder->fromParent())
|
|
|
- // );
|
|
|
-
|
|
|
- // $registry->addFieldResolver('Taxoterm', 'uuid',
|
|
|
- // $builder->produce('entity_uuid')
|
|
|
- // ->map('entity', $builder->fromParent())
|
|
|
- // );
|
|
|
-
|
|
|
- // $registry->addFieldResolver('Taxoterm', 'name',
|
|
|
- // $builder->produce('entity_label')
|
|
|
- // ->map('entity', $builder->fromParent())
|
|
|
- // );
|
|
|
-
|
|
|
- // $registry->addFieldResolver('Taxoterm', 'vocabulary',
|
|
|
- // $builder->produce('entity_bundle')
|
|
|
- // ->map('entity', $builder->fromParent())
|
|
|
- // );
|
|
|
- // }
|
|
|
+ protected function addTaxoterm(ResolverRegistryInterface $registry, ResolverBuilder $builder) {
|
|
|
+ // $registry->addFieldResolver('Query', 'alltags',
|
|
|
+ // $builder->compose(
|
|
|
+ // $builder->callback(function($parent, $arg){
|
|
|
+ // $entity_storage = \Drupal::entityTypeManager()->getStorage('taxonomy_term');
|
|
|
+ // $query = $entity_storage->getQuery()
|
|
|
+ // ->condition('vid', ['tag','tag_prod'], 'IN')
|
|
|
+ // ->accessCheck(TRUE);
|
|
|
+ // $results = $query->execute();
|
|
|
+ // return $results;
|
|
|
+ // }),
|
|
|
+ // $builder->produce('entity_load_multiple')
|
|
|
+ // ->map('type', $builder->fromValue('taxonomy_term'))
|
|
|
+ // ->map('ids', $builder->fromParent())
|
|
|
+ // )
|
|
|
+ // );
|
|
|
+
|
|
|
+ // $registry->addFieldResolver('Query', 'tag',
|
|
|
+ // $builder->produce('entity_load')
|
|
|
+ // ->map('type', $builder->fromValue('taxonomy_term'))
|
|
|
+ // ->map('bundles', $builder->fromValue(['tag']))
|
|
|
+ // ->map('id', $builder->fromArgument('id'))
|
|
|
+ // );
|
|
|
+ // $registry->addFieldResolver('Query', 'famille',
|
|
|
+ // $builder->produce('entity_load')
|
|
|
+ // ->map('type', $builder->fromValue('taxonomy_term'))
|
|
|
+ // ->map('bundles', $builder->fromValue(['famille']))
|
|
|
+ // ->map('id', $builder->fromArgument('id'))
|
|
|
+ // );
|
|
|
+ // $registry->addFieldResolver('Query', 'tagprod',
|
|
|
+ // $builder->produce('entity_load')
|
|
|
+ // ->map('type', $builder->fromValue('taxonomy_term'))
|
|
|
+ // ->map('bundles', $builder->fromValue(['tag_prod']))
|
|
|
+ // ->map('id', $builder->fromArgument('id'))
|
|
|
+ // );
|
|
|
+
|
|
|
+ // get all tags for a given familly
|
|
|
+ // $registry->addFieldResolver('Query', 'famillytags',
|
|
|
+ // $builder->compose(
|
|
|
+ // $builder->callback(function($parent, $arg){
|
|
|
+ // $entity_storage = \Drupal::entityTypeManager()->getStorage('node');
|
|
|
+ // $query = $entity_storage->getQuery()
|
|
|
+ // ->condition('type', ['texte', 'texte_prod'], 'IN')
|
|
|
+ // ->condition('field_famille', $arg->famillyid)
|
|
|
+ // ->accessCheck(TRUE);
|
|
|
+ // $results = $query->execute();
|
|
|
+ // return $results;
|
|
|
+ // }),
|
|
|
+ // $builder->produce('entity_load_multiple')
|
|
|
+ // ->map('type', $builder->fromValue('node'))
|
|
|
+ // ->map('ids', $builder->fromParent())
|
|
|
+ // // $builder->produce('entity_load_multiple')
|
|
|
+ // // ->map('type', $builder->fromValue('taxonomy_term'))
|
|
|
+ // // ->map('ids', $builder->fromParent())
|
|
|
+ // )
|
|
|
+ // );
|
|
|
+
|
|
|
+
|
|
|
+ $registry->addFieldResolver('Taxoterm', 'id',
|
|
|
+ $builder->produce('entity_id')
|
|
|
+ ->map('entity', $builder->fromParent())
|
|
|
+ );
|
|
|
+
|
|
|
+ $registry->addFieldResolver('Taxoterm', 'uuid',
|
|
|
+ $builder->produce('entity_uuid')
|
|
|
+ ->map('entity', $builder->fromParent())
|
|
|
+ );
|
|
|
+
|
|
|
+ $registry->addFieldResolver('Taxoterm', 'name',
|
|
|
+ $builder->produce('entity_label')
|
|
|
+ ->map('entity', $builder->fromParent())
|
|
|
+ );
|
|
|
+
|
|
|
+ $registry->addFieldResolver('Taxoterm', 'vocabulary',
|
|
|
+ $builder->produce('entity_bundle')
|
|
|
+ ->map('entity', $builder->fromParent())
|
|
|
+ );
|
|
|
+ }
|
|
|
|
|
|
|
|
|
// _ _ _
|