Skip to content
This repository was archived by the owner on Oct 31, 2022. It is now read-only.

CCB Entities

Jared Cobb edited this page Jan 7, 2018 · 2 revisions

What Is A CCB Entity?

Most of the CCB API services will represent items (such as Groups, Events, People, etc) as a collection of XML nodes.

For example, the group_profiles service will send a collection of <groups> where each group is represented by a <group> node like so:

<groups count="2">
    <group id="1">
        <name>Test Group One</name>
        <description>Group One Description</description>
        <campus id="1">Campus One</campus>
        <current_members>115</current_members>
        <meeting_day id="10">Sunday</meeting_day>
        <meeting_time id="20">Morning</meeting_time>
        <childcare_provided>false</childcare_provided>
        <created>2017-06-17 04:02:53</created>
        <modified>2018-04-30 16:36:38</modified>
    </group>
    <group id="2">
        <name>Test Group Two</name>
        <description>Group Two Description</description>
        <campus id="1">Campus One</campus>
        <current_members>80</current_members>
        <meeting_day id="30">Weekdays</meeting_day>
        <meeting_time id="40">Evening</meeting_time>
        <childcare_provided>true</childcare_provided>
        <created>2017-06-17 04:02:53</created>
        <modified>2018-04-30 16:36:38</modified>
    </group>
</groups>

So in general, a CCB Entity is anything that can be represented by a CCB API service as a single XML node.

If CCB has an API service that organizes a "thing" as a collection of nodes, it can be easily mapped to a new WordPress Custom Post Type.

Entity Properties

CCB Entities have several properties on the node. For example, looking at the <group> node, you can see there is a <name>, <description>, <main_leader>, <meeting_day>, etc.

These properties can be mapped to one of three different parts of a WordPress Post:

Post Property

These are the normal (default) properties on a WP_Post object.

The easiest examples to understand are the post_title and post_content properties. Most CCB Entities will have some sort of "name" or "description". It makes the most sense to map these to the post_title and post_content.

Post Meta

Some CCB Entity properties make sense to save as Post Meta (sometimes called Custom Fields). These are properties that might be unique to each and every Entity (and not typically shared across Entities).

For example, the <current_memebers> (a count) of a Group would be a unique property for that specific group.

Custom Taxonomies

Custom Taxonomies (i.e. Custom Categories & Tags) are properties that get shared across several Entities.

For example, looking at <meeting_day>, a church might organize their group meeting days into Sunday and Weekdays. These are property values that can be shared across several groups. By mapping these Entity properties to Custom Taxonomies you will be able to easily filter / display various groups by Category of "Meeting Day".

Clone this wiki locally