Skip to content

Commit

Permalink
[Docs] Update Docs to Reflect v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
onairmarc committed Dec 5, 2024
1 parent 9a4b35e commit 2dc36c0
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 170 deletions.
27 changes: 7 additions & 20 deletions docs/Calendar/Events.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ To start using the Calendar Event API, add the following to the top of your file
use EncoreDigitalGroup\PlanningCenter\Objects\Calendar\Event;
```

<include from="SnippetLibrary.md" element-id="setupThePcoClient"></include>

### Event Class

Now we can create a new instance of the Event class;

```php
$event = new Event($client);
$event = Event::make($clientId, $clientSecret);
```

### All Events
Expand Down Expand Up @@ -45,33 +43,22 @@ $event->future();

### Get an Event

To get a single Planning Center Calendar Event, pass the ```id``` of the event to the ```get()```
method
To get a single Planning Center Calendar Event, use the `forEventId()` method and then chain the `get()`
method.

```php
$event->eventId = YOUR_EVENT_ID;
$event->get();
$event->forEventId(YOUR_EVENT_ID)->get();
```

### Get Event Instances

```php
$event->eventId = YOUR_EVENT_ID;
$event->instances();
$event->forEventId(YOUR_EVENT_ID)->instances();
```

### Get a Single Event Instance

```php
$event->eventId = YOUR_EVENT_ID;
$event->eventInstanceId = YOUR_EVENT_INSTANCE_ID;
$event->instance();
```

### Get a Single Event Connection

```php
$event->eventId = YOUR_EVENT_ID;
$event->connectionId = YOUR_CONNECTION_ID;
$event->connection();
$eventInstance = EventInstance::make($clientId, $clientSecret);
$eventInstance->forEventInstanceId(YOUR_EVENT_INSTANCE_ID)->get();
```
15 changes: 2 additions & 13 deletions docs/Calendar/TagGroups.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ To start using the Calendar TagGroup API, add the following to the top of your f
use EncoreDigitalGroup\PlanningCenter\Objects\Calendar\TagGroup;
```

<include from="SnippetLibrary.md" element-id="setupThePcoClient"></include>

### TagGroup Class

Now we can create a new instance of the TagGroup class;

```php
$tagGroup = new TagGroup($client);
$tagGroup = TagGroup::make($clientId, $clientSecret);
```

### All Tag Groups
Expand All @@ -29,14 +27,5 @@ $tagGroup->all();
### Get All Tags in Tag Group

```php
$tagGroup->tagGroupId = TAG_GROUP_ID;
$tagGroup->tags();
```

### Get a Single Tag in a Tag Group

```php
$tagGroup->tagGroupId = TAG_GROUP_ID;
$tagGroup->tagId = TAG_ID
$tagGroup->tag();
$tagGroup->forTagGroupId(TAG_GROUP_ID)->tags();
```
19 changes: 4 additions & 15 deletions docs/Groups/Event.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use EncoreDigitalGroup\PlanningCenter\Objects\Groups\Event;
Now we can create a new instance of the Group class;

```php
$groupEvent = new Event($clientConfig);
$groupEvent = Event::make($clientId, $clientSecret);
```

### All Groups
Expand All @@ -22,22 +22,11 @@ To get all group events that exist in Planning Center, use the following method:
$groupEvent->all();
```

### Get Events for a Specific Group

To get events for a specific group, set the ```$groupId``` property to the ```id``` of the specific
group you wish to retrieve events for.

```php
$groupEvent->groupId = 123;
$groupEvent->all();
```

### Get a Specific Group Event

To get specific group event, set the ```$eventId``` property to the ```id``` of the specific
group event you wish to retrieve.
To get a single Planning Center Group Event, use the `forEventId()` method and then chain the `get()`
method.

```php
$groupEvent->eventId = 123;
$groupEvent->get();
$groupEvent->forEventId(YOUR_EVENT_ID)->get();
```
7 changes: 3 additions & 4 deletions docs/Groups/Group.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use EncoreDigitalGroup\PlanningCenter\Objects\Groups\Group;
Now we can create a new instance of the Group class;

```php
$group = new Group($clientConfig);
$group = Group::make($clientId, $clientSecret);
```

### All Groups
Expand All @@ -24,9 +24,8 @@ $group->all();

### Get a Specific Group

To get a specific group, set the ```$groupId``` property to the ```id``` of the specific group you wish to retrieve.
To get a single Planning Center Group, use the `forGroupId()` method and then chain the `get()` method.

```php
$group->groupId = 123;
$group->get();
$group->forGroupId(YOUR_GROUP_ID)->get();
```
22 changes: 3 additions & 19 deletions docs/Groups/Tag.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,7 @@ use EncoreDigitalGroup\PlanningCenter\Objects\Groups\Tag;
Now we can create a new instance of the Tag class;

```php
$tag = new Tag($client);
```

### All Tag Groups

To get all group tags that exist in Planning Center, use the following method:

```php
$tag->all();
$tag = Tag::make($clientId, $clientSecret);
```

# Tags
Expand All @@ -30,16 +22,8 @@ $tag->all();
$tag->all();
```

### Get a Single Tag

```php
$tag->tagId = TAG_ID;
$tag->get();
```

### Get Groups by Tag
### Get Tags for a Group

```php
$tag->tagId = TAG_ID;
$tag->groups();
$tag->forGroupId(TAG_ID)->groups();
```
12 changes: 2 additions & 10 deletions docs/Groups/TagGroup.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use EncoreDigitalGroup\PlanningCenter\Objects\Groups\TagGroup;
Now we can create a new instance of the TagGroup class;

```php
$tagGroup = new TagGroup($client);
$tagGroup = TagGroup::make($clientId, $clientSecret);
```

### All Tag Groups
Expand All @@ -27,13 +27,5 @@ $tagGroup->all();
### Get All Tags in Tag Group

```php
$tagGroup->tagGroupId = TAG_GROUP_ID;
$tagGroup->tags();
```

### Get a Single Tag in a Tag Group

```php
$tagGroup->tagId = TAG_ID;
$tagGroup->tag();
$tagGroup->forTagGroupId(TAG_GROUP_ID)->tags();
```
74 changes: 0 additions & 74 deletions docs/People/Email.md

This file was deleted.

23 changes: 10 additions & 13 deletions docs/People/Person.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Person
# Email

To start using the Person API, add the following to the top of your file:

Expand All @@ -11,7 +11,7 @@ use EncoreDigitalGroup\PlanningCenter\Objects\People\Person;
Now we can create a new instance of the Person class;

```php
$person = new Person($clientConfig);
$person = Person::make($clientId, $clientSecret);
```

### All People
Expand All @@ -26,21 +26,20 @@ $person->all();

### Get a Specific Person

To get a specific person, pass the ```$person``` object created earlier with ```$person->id```
set to the ```id``` of the specific person you want.
To get a single Person from Planning Center, use the `forPersonId()` method and then chain the `get()`
method.

```php
$person->id = 123;
$person->get();
$person->forPersonId(PERSON_ID)->get();
```

### Create a new Person

To create a new Person, you must set the first and last name of the Person.

```php
$person->first_name = 'John';
$person->last_name = 'Smith';
$person->attributes->firstName = "John";
$person->attributes->lastName = "Smith";
$person->create();
```

Expand All @@ -54,9 +53,8 @@ For example, let's say that when we created John Smith in the previous section,
is spelled Jon and not John. Let's assume that his Person ID is 123.

```PHP
$person->id = 123;
$person->first_name = 'Jon';
$person->update();
$person->attributes->firstName = "Jon";
$person->forPersonId("123")->update();
```

<note>Except for the ID, you only need to pass fields that are being updated.</note>
Expand All @@ -66,8 +64,7 @@ $person->update();
To delete a person from planning center, you just need to pass in the ID.

```PHP
$person->id = 123;
$person->delete();
$person->forPersonId("123")->delete();
```

Note: There is no way to recover a person once they have been deleted in Planning Center.
Expand Down
2 changes: 1 addition & 1 deletion docs/People/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# People Overview

[Person](Person.md)
[Email](Email.md)
Email (Docs in Progress)
3 changes: 2 additions & 1 deletion docs/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
| Version | Supported |
|---------|-----------|
| 0.x ||
| 1.x ||
| 1.x ||
| 2.x ||

## Reporting a Vulnerability

Expand Down

0 comments on commit 2dc36c0

Please sign in to comment.