jchr86/calendr

Object Oriented calendar management

2.1.4 2020-03-22 21:36 UTC

README

Build Status Scrutinizer Code Quality Code Coverage SensioLabsInsight

CalendR is an Object Oriented Calendar management library on top of PHP5.3+ Date objects. You can use it to deal with all your needs about calendars and events.

Complete documentation

Complete documentation is available here.

Installation

CalendR is hosted on packagist, you can install it with composer.

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

$ composer require jchr86/calendr

Applications that use Symfony Flex

Enable the Bundle.

Enable the bundle by adding it to the list of registered bundles in the config/bundles.php file of your project:

// config/bundles.php

return [
    // ...
    CalendR\Bridge\Symfony\Bundle\CalendRBundle::class => ['all' => true],
];

Register an event provider.

// src/Repository/EventRepository.php

namespace App\Repository;

use App\Entity\Event;
use CalendR\Bridge\Doctrine\ORM\EventRepository;
use CalendR\Event\Provider\ProviderInterface;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Common\Persistence\ManagerRegistry;
use Doctrine\ORM\Query\Expr;

class EventRepository extends ServiceEntityRepository implements ProviderInterface
{
    use EventRepository;

    public function __construct(ManagerRegistry $registry)
    {
        parent::__construct($registry, Event::class);
    }
}
// config/services.yaml

services:
    App\Repository\EventRepository:
        tags:
            - { name: calendr.event_provider }

Contribute

Calendar is open to contributions. Merging delays can vary depending to my free time, but always be welcome.

License

CalendR is licensed under the MIT License - see the LICENSE file for details