2017 © Pedro Peláez
 

library common-bundle

The bundle for collecting common libraries and everything else

image

ronte-ltd/common-bundle

The bundle for collecting common libraries and everything else

  • Monday, July 31, 2017
  • by CawaKharkov
  • Repository
  • 2 Watchers
  • 0 Stars
  • 137 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

The Common Bundle

This bundle contains some methods for help, (*1)

Installation

Composer

composer require ronte-ltd/common-bundle

AppKernel.php

new RonteLtd\ElasticBundle\RonteLtdCommonBundle()

Usage

Entity

<?php

namespace AppBundle\Entity;

use RonteLtd\CommonBundle\Entity\AbstractBaseEntity;
use Doctrine\ORM\Mapping as ORM;

/**
 * Entity
 *
 * @ORM\Entity(repositoryClass="AppBundle\Repository\DefaultRepository")
 * @ORM\Table(name="some_entity")
 */
class Entity extends AbstractBaseEntity
{
}

Repository

<?php

namespace AppBundle\Repository;

use RonteLtd\CommonBundle\Repository\AbstractBaseRepository;

class DefaultRepository extends AbstractBaseRepository
{
}

Service

<?php

namespace AppBundle\Service;

use RonteLtd\CommonBundle\Service\AbstractBaseService;

class EntityService extends AbstractBaseService
{
}

For explanation we can use this code to define custom service, (*2)

services:
    ## Repositories
    app.entity_repository:
        class: AppBundle\Repository\DefaultRepository
        factory: ["@doctrine.orm.entity_manager", getRepository]
        arguments:
            - AppBundle\Entity\Entity

    ## Services
    app.entity_service:
        class: AppBundle\Service\EntityService
        arguments: ["@validator", "@event_dispatcher"]
        calls:
            - [setRepository, ['@app.entity_repository']]

Controller

For quick example, (*3)

// We are recieving the service with repository
$service = $this->get('app.entity_service');
$entity = new Entity();

// validate
$result = $service->validate($entity)

// save|remove
$service->save($entity);
$service->remove($entity);

// paginate
$service->paginate($query)

The Versions

31/07 2017

dev-refactoring

dev-refactoring

The bundle for collecting common libraries and everything else

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexey Astafev

19/05 2017

dev-master

9999999-dev

The bundle for collecting common libraries and everything else

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexey Astafev

19/05 2017

dev-develop

dev-develop

The bundle for collecting common libraries and everything else

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexey Astafev

19/05 2017

v3.1

3.1.0.0

The bundle for collecting common libraries and everything else

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexey Astafev

14/04 2017

v3.0

3.0.0.0

The bundle for collecting common libraries and everything else

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexey Astafev

20/01 2017

v2.0

2.0.0.0

The bundle for collecting common libraries and everything else

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexey Astafev

18/01 2017

v1.2

1.2.0.0

The bundle for collecting common libraries and everything else

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexey Astafev

27/12 2016

v1.1

1.1.0.0

The bundle for collecting common libraries and everything else

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexey Astafev

09/12 2016

v1.0

1.0.0.0

The bundle for collecting common libraries and everything else

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexey Astafev