Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dbp-relay-base-organization-bundle
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
digital blueprint
Relay API Gateway
dbp-relay-base-organization-bundle
Commits
c92db122
Unverified
Commit
c92db122
authored
3 years ago
by
Bekerle, Patrizio
Browse files
Options
Downloads
Patches
Plain Diff
Add OrganizationProviderInterface documentation
parent
6b9b080c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+56
-0
56 additions, 0 deletions
README.md
with
56 additions
and
0 deletions
README.md
+
56
−
0
View file @
c92db122
...
@@ -108,3 +108,59 @@ For above class you need to add this to your `src/Resources/config/services.yaml
...
@@ -108,3 +108,59 @@ For above class you need to add this to your `src/Resources/config/services.yaml
Dbp\Relay\BaseBundle\API\PersonProviderInterface
:
Dbp\Relay\BaseBundle\API\PersonProviderInterface
:
'
@YourUniversity\Service\PersonProvider'
'
@YourUniversity\Service\PersonProvider'
```
```
## OrganizationProvider service
For services that need to fetch organizations you need to create a service that implements
[
OrganizationProviderInterface
](
https://gitlab.tugraz.at/dbp/relay/dbp-relay-base-bundle/-/blob/main/src/API/OrganizationProviderInterface.php
)
in your application.
### Example
#### Service class
You can for example put below code into
`src/Service/OrganizationProvider.php`
:
```
php
<?php
declare
(
strict_types
=
1
);
namespace
YourUniversity\Service
;
use
Dbp\Relay\BaseBundle\API\OrganizationProviderInterface
;
use
Dbp\Relay\BaseBundle\Entity\Organization
;
class
OrganizationProvider
implements
OrganizationProviderInterface
{
public
function
getOrganizationById
(
string
$identifier
,
string
$lang
):
Organization
{
return
some_method_that_fetches_an_organization_by_id
(
$identifier
,
$lang
);
}
/**
* @return Organization[]
*/
public
function
getOrganizationsByPerson
(
Person
$person
,
string
$context
,
string
$lang
):
array
{
return
some_method_that_fetches_an_organization_by_person
(
$person
,
$context
,
$lang
);
}
/**
* @return Organization[]
*/
public
function
getOrganizations
(
string
$lang
):
array
{
return
some_method_that_fetches_all_organizations
(
$lang
);
}
}
```
#### Services configuration
For above class you need to add this to your
`src/Resources/config/services.yaml`
:
```
yaml
Dbp\Relay\BaseBundle\API\OrganizationProviderInterface
:
'
@YourUniversity\Service\OrganizationProvider'
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment