memberpoint/wos-activities-bundle

There is no license information available for the latest version (v1.09) of this package.

Installs: 50

Dependents: 3

Suggesters: 11

Type:symfony-bundle

v1.09 2019-03-07 00:54 UTC

README

This bundle implements the Activity for the WOS Bundles, the Activicties Bundle will be responsable for traking changes and activity information.

Installation

These instructions assume the consuming application uses Symfony Flex.

Add the following repository to the application's composer.json file:

"repositories": [
    {
        "type": "composer",
        "url": "http://code.int.savagebull.com.au"
    }
]

Ensure secure-http is set to false.

Open a command console, enter the project directory, and execute:

$ composer require memberpoint/wos-activities-bundle

Usage

This bundle suppose to be a suggested bundle so make sure you add to your composer file:

    "suggest": {
      ...,
     "memberpoint/wos-activities-bundle": "Allows for the storing of activities."
     }

In order to persist an activity event an instance of ActivityManager class is required.

As the activities bundle may or may not be included in your bundle at run time, whatever class is responsable for persisting the activities has to have an optional dependency on the ActivityManager class, to do that your class has to have as parameter an ActivityManagerInterface with default value as null as the following code:

ActivityManagerInterface $activityWallManager = null

and in your services file make sure of inserting a question mark before passing the ActivityManager service as it might not be an existing service.

'@?memberpoint_wos_activities.activity_manager'

To persist an activity the method ActivityManagerInterface::processEvent will be used, please refer to it documentation.

Once persisted your bundle will also be responsable for parsing the activity, therefore a class that implements the ActivityParserInterface and add the tag wos_activities.activity_parser

tags:
  - { name: wos_activities.activity_parser }

Notes:

Make sure to that the type given in ActivityManagerInterface::processEvent is consistent with the type that your resolver is able to resolve. You can also use the action to resolve the activity according to it.

A concrete implementation of the activity bundle can be found here.

Testing

These instructions assume PHPUnit is installed.

Ensure the bundle has all development dependencies available.

Open a command console, enter the project directory, and execute:


$ phpunit | phpunit --testdox --coverage-text