Download the PHP package swoopster/objectmanagerbundle without Composer

On this page you can find all versions of the php package swoopster/objectmanagerbundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package objectmanagerbundle

Installation

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Step 2: Enable the Bundle

Then, enable the bundle by adding the following line in the app/AppKernel.php file of your project:

<?php
// app/AppKernel.php

class AppKernel extends Kernel
{
    public function registerBundles()
    {

        $bundles = array(
            new Swoopster\ObjectManagerBundle\SwoopsterObjectManagerBundle()
        );

    }

}

Step 3: Configure Bundle

Define coniguration parameters to customize bundle for your own needs. You need to define which bundles should be managed by the ObjectManager. Currently this bundle supports only the xml-mapping-format.

swoopster_object_manager:
    model_dir: Model #default
    mapping_format: xml #default
    bundles:
        - {namespace: Swoopster\TestBundle}

Usage

Define Mappings

Define your mapping definitions inside BundleFolder/Resources/config/doctrine/model. Currently only xml mappings supported!

Use Manager

To get the manager use $container->get('id') or use the factory. To use the factory the manager service has to be tagged with the following tag:

<tag name="swoopster.object_manager"/>

Now you can get an Manager by using the $conatainer->get('swoopster.object_manager.manager_factory')->getManager($instanceOfManagedObject)

Standard Manager

To use a manager for an object without customization, define a service like below

<services>
    <service id="swoopster_test.model.test_object_manager" parent="swoopster.object_manager.doctrine_manager">
        <argument>Swoopster\TestBundle\Model\TestModel</argument>
    </service>
</services>

Customizable Manager

To extend the standardmanager define a manager class which extends from Swoopster\ObjectManagerBundle\Doctrine\DoctrineManager and register this class as a service. see example below

<services>
    <service id="swoopster_test.model.test_object_manager" class="Swoopster\TestBundle\Model\TestObjectManager" parent="swoopster.object_manager.doctrine_manager">
        <argument>Swoopster\TestBundle\Model\TestModel</argument>
    </service>
</services>

Manager Functions

Create

Get a new instance of managed modelclass

$manager->create()

Save

save or update an instance of managed modelclass. Second argument defines if orm should persist object immediately or later, default is true (immediately).

$manager->save($object, $flush)

Delete

delete an existing instance of managed modelclass

$manager->delete($object, $flush)

Find

the manager supports a predefined set of methods to find objects in database. you can find supported functions in Swoopster\ObjectManagerBundle\Model\ManagerInterface

$manager->find*()

Lifecycle Events

To use the lifecycle events you need to comply with the following requirments

  1. the model to be managed must implement Swoopster\ObjectManagerBundle\Model\EventDrivenModelInterface
  2. the manager belonging to this model must implement Swoopster\ObjectManagerBundle\Model\ManagerEventInterface
  3. manager must be registered in the factory

Supported Events

All events are expecting an instance of the managed model as argument

License

This bundle is under the MIT license. See the complete license in the bundle:

Resources/meta/LICENSE

All versions of objectmanagerbundle with dependencies

PHP Build Version
Package Version
Requires symfony/framework-bundle Version >=2.3.0
symfony/security-bundle Version >=2.3.0
doctrine/orm Version >=2.4.0
doctrine/doctrine-bundle Version >=1.2.0@dev
sensio/framework-extra-bundle Version ~3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package swoopster/objectmanagerbundle contains the following files

Loading the files please wait ...