loevgaard/doctrine-manager

A manager class for Doctrine

v1.0.0 2017-09-27 09:36 UTC

This package is auto-updated.

Last update: 2024-02-06 08:33:18 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

This is a Doctrine Manager primary for Symfony applications, but can be used in all applications using Doctrine.

Install

Via Composer

$ composer require loevgaard/doctrine-manager

Usage

Say you have an Entity named YourEntity then you will create a manager as easy as:

<?php
namespace Loevgaard\DoctrineManager;

class YourManager extends Manager
{
    
}

if you want code completion or need to do some other stuff you can override the CRUD methods like so:

<?php
namespace Loevgaard\DoctrineManager;

class YourManager extends Manager
{
    /**
     * @return YourEntity
     */
    public function create()
    {
        return parent::create();
    }

    /**
     * @param YourEntity $obj
     */
    public function delete($obj)
    {
        parent::delete($obj);
    }

    /**
     * @param YourEntity $obj
     * @param bool $flush
     */
    public function update($obj, $flush = true)
    {
        parent::update($obj, $flush);
    }
}

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email joachim@loevgaard.dk instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.