PHPackages                             priorist/edm-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. priorist/edm-sdk

ActiveLibrary[API Development](/categories/api)

priorist/edm-sdk
================

A PHP library to interact with the RESTful API of the Education Manager (EDM).

1.1.2(1mo ago)1477[1 issues](https://github.com/priorist/edm-sdk-php/issues)1Apache-2.0PHPPHP ^7.4.1 || ^8.0CI passing

Since Apr 3Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/priorist/edm-sdk-php)[ Packagist](https://packagist.org/packages/priorist/edm-sdk)[ RSS](/packages/priorist-edm-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (14)Used By (1)

EDM SDK PHP
===========

[](#edm-sdk-php)

[![Build Status](https://camo.githubusercontent.com/476a479952a46e6e9739920a2bcf69c527d4f6b7a516a9ba6d6d7bdc57b0726d/68747470733a2f2f7472617669732d63692e6f72672f7072696f726973742f6169732d73646b2d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/priorist/edm-sdk-php)[![License](https://camo.githubusercontent.com/4f51d37d02e59e30c24b656fceafcfbb2f604d4e86de2bbc1db885b45fb029dd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7072696f726973742f65646d2d73646b2d706870)](https://camo.githubusercontent.com/4f51d37d02e59e30c24b656fceafcfbb2f604d4e86de2bbc1db885b45fb029dd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7072696f726973742f65646d2d73646b2d706870)[![GitHub release (latest SemVer including pre-releases)](https://camo.githubusercontent.com/80ea7619b708da4d68f562c17b9178ed1ef01eafa36befafa8efdc4763de9c10/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f7072696f726973742f65646d2d73646b2d7068703f696e636c7564655f70726572656c656173657326736f72743d73656d766572)](https://camo.githubusercontent.com/80ea7619b708da4d68f562c17b9178ed1ef01eafa36befafa8efdc4763de9c10/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f7072696f726973742f65646d2d73646b2d7068703f696e636c7564655f70726572656c656173657326736f72743d73656d766572)[![PHP from Travis config](https://camo.githubusercontent.com/4118d3eadec1beafebe0601b6ed7fd0f9a3dc78ababea2735492c2aafc295f29/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7068702d762f7072696f726973742f6169732d73646b2d706870)](https://camo.githubusercontent.com/4118d3eadec1beafebe0601b6ed7fd0f9a3dc78ababea2735492c2aafc295f29/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7068702d762f7072696f726973742f6169732d73646b2d706870)

A PHP library to interact with the RESTful API of the [Education Manager](https://education-manager.de) (EDM).

Install with Composer
---------------------

[](#install-with-composer)

```
docker compose run --rm composer install
```

Usage
-----

[](#usage)

### Init client

[](#init-client)

```
use Priorist\EDM\Client\Client;

$client = new Client('https://edm.example.com', 'CLIENT_ID', 'CLIENT_SECRET');

// $client now works with global permission, e.g. to read events.

$events = $client->event->findUpcoming();

// To switch to permissions of a given user, e.g. to read participant data, call logIn
// with the user’s login name and password:

$accessToken = $client->logIn('USER_NAME', 'PASSWORD');

$client->event->findParticipating();

// You may store $accessToken in your session to re-use it later:

$client->setAccessToken($accessToken);
```

### Events

[](#events)

#### Single event for a given ID

[](#single-event-for-a-given-id)

```
$event = $client->event->findById(4711);

if ($event !== null)
    echo $event['event_base_name'] . "\n";
}
```

#### List of upcoming events

[](#list-of-upcoming-events)

```
$upcomingEvents = $client->event->findUpcoming();

foreach ($upcomingEvents as $event) {
    echo $event['event_base_name'] . "\n";
}
```

### Categories

[](#categories)

#### Single category for a given ID

[](#single-category-for-a-given-id)

```
$location = $client->category->findById(4711);

if ($category !== null)
    echo $category['name'] . "\n";
}
```

#### List of all categories

[](#list-of-all-categories)

```
$categories = $client->category->findAll();

foreach ($categories as $category) {
    echo $category['name'] . "\n";
}
```

### Event locations

[](#event-locations)

#### Single location for a given ID

[](#single-location-for-a-given-id)

```
$location = $client->eventLocation->findById(4711);

if ($location !== null)
    echo $location['name'] . "\n";
}
```

#### List of all locations

[](#list-of-all-locations)

```
$locations = $client->eventLocation->findAll();

foreach ($locations as $location) {
    echo $location['name'] . "\n";
}
```

### Lecturers

[](#lecturers)

#### Single lecturer for a given ID

[](#single-lecturer-for-a-given-id)

```
$lecturer = $client->lecturer->findById(4711);

if ($lecturer !== null)
    echo $lecturer['name'] . "\n";
}
```

#### List of all lecturers

[](#list-of-all-lecturers)

```
$lecturers = $client->lecturer->findAll();

foreach ($lecturers as $lecturer) {
    echo $lecturer['name'] . "\n";
}
```

### Tags

[](#tags)

#### Single tag for a given ID

[](#single-tag-for-a-given-id)

```
$lecturer = $client->tag->findById(4711);

if ($tag !== null)
    echo $tag['name'] . "\n";
}
```

#### List of all tags

[](#list-of-all-tags)

```
$tags = $client->tag->findAll();

foreach ($tags as $tag) {
    echo $tag['name'] . "\n";
}
```

### Enrollments

[](#enrollments)

#### Enroll for a given event

[](#enroll-for-a-given-event)

```
use Priorist\EDM\Client\Rest\ClientException;

$enrollment = [
    'first_name'    => 'John',
    'last_name'     => 'Doe',
    'event'         => 4711,
    'price'         => 4712,
];

try {
    $enrollment = $client->enrollment->create($enrollment);
} catch (ClientException $e) {
    $errors = $e->getDetails(); // Contains errors for missing/invalid fields/values
}

echo $enrollment['id']; // Holds the resulting ID on success.
```

### Users

[](#users)

#### Create user

[](#create-user)

```
use Priorist\EDM\Client\Rest\ClientException;

$user = [
    'first_name'                    => 'John',
    'last_name'                     => 'Doe',
    'title'                         => 'M',
    'main_contact_info'             => [
        'email' => 'john@doe.com'
    ],
    'prevent_duplicates'            => true,
];

try {
    $user = $client->user->create($user);
} catch (ClientException $e) {
    $errors = $e->getDetails(); // Contains errors for missing/invalid fields/values
}

echo $user['id']; // Holds the resulting ID on success.
```

### User Lists

[](#user-lists)

#### Add user to list(s)

[](#add-user-to-lists)

```
use Priorist\EDM\Client\Rest\ClientException;

$lists = [
    'data' => [
        'list_data' => [
            [
                'user_list' => 1,
                'user' => 42,
            ],
            [
                'user_list' => 2,
                'user' => 42,
            ],
        ],
        'consent_method' => 'trigger_confirmation',
    ]
];

try {
    $lists = $client->userList->createBulk($lists);
} catch (ClientException $e) {
    $errors = $e->getDetails(); // Contains errors for missing/invalid fields/values
}
```

### Generic requests

[](#generic-requests)

If you do not find a suitable method of a given repository, you may use the more generic methods `fetchCollection($params = [])` and `fetchSingle(int $id, array $params = [])`.

E.g. `$client->event->findUpcoming()` equals

```
$client->event->fetchCollection([
    'ordering' => 'first_day',
    'first_day__gte' => date('Y-m-d'),
]);
```

You can even call any endpoint you like, even the ones without an actual repository:

```
$client->getRestClient()->fetchCollection('events', [
    'ordering' => 'first_day',
    'first_day__gte' => date('Y-m-d'),
]);
```

Class docs
----------

[](#class-docs)

Current PHPDocs can be viewed here:

Run tests
---------

[](#run-tests)

Enable `compose.override.yml` and run

```
docker compose run --rm test
```

XDebug support for Docker for Mac included.

To create and view a detailed, browsable test coverage report run

```
docker compose run --rm test tests --coverage-html test_results/coverage && open test_results/coverage/index.html
```

Generate docs
-------------

[](#generate-docs)

```
docker compose run --rm docs && open docs/index.html
```

Build \*.phar archive
---------------------

[](#build-phar-archive)

To use the SDK in legacy applications, you may build and include a \*.phar package in your application.

Download phar-composer first:

```
curl --location --output phar-composer.phar https://clue.engineering/phar-composer-latest.phar
```

Build the archive:

```
docker compose run --rm phar
```

To use the client, include the autoload of the archive:

```
include 'edm-sdk.phar/vendor/autoload.php';
```

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance76

Regular maintenance activity

Popularity16

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 59% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~217 days

Recently: every ~321 days

Total

11

Last Release

50d ago

Major Versions

0.6.1 → 1.0.02024-04-10

PHP version history (3 changes)0.1.0PHP ^7.4

0.6.0PHP ^7.4.1

0.6.1PHP ^7.4.1 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/994357c5469654d3d187a918046a1700c502c4cd2298dd417b4819ca774c37fa?d=identicon)[priorist](/maintainers/priorist)

---

Top Contributors

[![intellent](https://avatars.githubusercontent.com/u/2074113?v=4)](https://github.com/intellent "intellent (46 commits)")[![FabDeep](https://avatars.githubusercontent.com/u/25568357?v=4)](https://github.com/FabDeep "FabDeep (30 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/priorist-edm-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/priorist-edm-sdk/health.svg)](https://phpackages.com/packages/priorist-edm-sdk)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[dcblogdev/laravel-microsoft-graph

A Laravel Microsoft Graph API (Office365) package

168285.5k1](/packages/dcblogdev-laravel-microsoft-graph)[dcblogdev/laravel-xero

A Laravel Xero package

53129.1k1](/packages/dcblogdev-laravel-xero)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
