PHPackages                             belsym/common-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. belsym/common-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

belsym/common-bundle
====================

A collection of classes commonly used throughout my projects

16PHP

Since Aug 2Pushed 12y ago1 watchersCompare

[ Source](https://github.com/belsym/CommonBundle)[ Packagist](https://packagist.org/packages/belsym/common-bundle)[ RSS](/packages/belsym-common-bundle/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

CommonBundle
============

[](#commonbundle)

A collection of classes commonly used throughout my projects

PLEASE NOTE:
------------

[](#please-note)

This package is currently broken. It's **experimental** and in the **very** early stages of development so please don't use it if your project is critical... it's no good for that!

If you want to make suggestions though or get involved, you're welcome to. Give me a shout.

Features
========

[](#features)

Entities
--------

[](#entities)

This bundle incorporates stof\\DoctrineExtensionsBundle and doctrine\\DoctrineFixturesBundle to make working with entities slightly easier.

The entities included are:

### BaseEntity

[](#baseentity)

Useful class that adds a standard, integer-based id field and timestampable behaviour on insert and update

#### How to use

[](#how-to-use)

TODO

### BaseUser

[](#baseuser)

A class that adds basic information about a person. Firstname, lastname and date of birth fields are added to any Entity extending from this class.

#### How to use

[](#how-to-use-1)

TODO

### BaseLookup

[](#baselookup)

There are issues in using Enums in a sqlite database. Mainly because it doesn't support an Enum or anything like it...

So, the BaseLookup makes it easy to add lookup or reference tables to your database as related entities.

#### How to use

[](#how-to-use-2)

TODO

DBAL Types
----------

[](#dbal-types)

### EnumType

[](#enumtype)

TODO

Abstract TestCases
------------------

[](#abstract-testcases)

### BaseDatabaseTestCase

[](#basedatabasetestcase)

TODO

### BaseFixtureLoadingTestCase

[](#basefixtureloadingtestcase)

TODO

Installation
============

[](#installation)

Obtain the Bundle
-----------------

[](#obtain-the-bundle)

add the requirement to your composer.json

```
{
	"require": {
    	"beldougie/beldougie-common-bundle": "*"
	}
}

```

Add Bundles to the application kernel
-------------------------------------

[](#add-bundles-to-the-application-kernel)

```
// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
    	//..
    	new Symfony\Bundle\DoctrineFixturesBundle\DoctrineFixturesBundle(),
    	new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
    	new Beldougie\CommonBundle\BeldougieCommonBundle(),
    	//..
  	)
 }

```

Configure the bundle
--------------------

[](#configure-the-bundle)

At present, the only configuration options necessary to add are those for Timestampable from the stof\\DoctrineExtensionsBundle

You **must** activate timestampable as the abstract entities included in this bundle use Timestampable in their annotated configuration.

For more detailed information about using other aspects of the DoctrineExtensionsBundle see [the documentation](https://github.com/stof/StofDoctrineExtensionsBundle/blob/master/Resources/doc/index.rst)

### Timestampable

[](#timestampable)

```
# Stof Doctrine Extensions
stof\_doctrine\_extensions:
	orm:
		default:
  			timestampable: true

```

Testing
=======

[](#testing)

NB: This section is only relevant if you need to run the BeldougieCommon tests directly within your application for some reason, for example to if you have configuration issues or you want to work on the bundles.

IMPORTANT!
----------

[](#important)

If you run the tests without having configured a test database, you **WILL** destroy **ALL** of your data irrecoverably.

Configure the test environment
------------------------------

[](#configure-the-test-environment)

By default, phpunit will only run tests located in the src/ folder. For this reason, if you don't want to run the tests you don't need to ready any further.

Due to the nature of this bundle the tests included rely on a database. They utilise data fixtures and load automatically when run. Each setup will generate the schema while each teardown DROPS the schema.

We recommend copying phpunit.xml.dist to phpunit.xml and making these changes there. If you add phpunit.xml to .gitignore, it will not get saved in git and the tests will only get run locally on your system and not in a deployment or CI process.

### Add the tests to your phpunit configuration

[](#add-the-tests-to-your-phpunit-configuration)

```

        ../vendor/beldougie/beldougie-*-bundle/Beldougie/*Bundle/Tests

```

Note the "\*" wildcard. Currently, My other bundle(s) use the same naming configuration, so you will only need to do this once.

Configure an in-memory database
-------------------------------

[](#configure-an-in-memory-database)

In your app/config/config\_test.yml, add the following

```
// app/config/config_test.yml
doctrine:
	dbal:
		driver:   pdo_sqlite
		host:     localhost
		dbname:   db_test
		user:     db_user
		charset:  UTF8
		password: db_pwd
		memory:   true
	orm:
		auto_generate_proxy_classes: true

```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1800508?v=4)[Matt Keeble](/maintainers/beldougie)[@beldougie](https://github.com/beldougie)

---

Top Contributors

[![beldougie](https://avatars.githubusercontent.com/u/1800508?v=4)](https://github.com/beldougie "beldougie (17 commits)")

### Embed Badge

![Health badge](/badges/belsym-common-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/belsym-common-bundle/health.svg)](https://phpackages.com/packages/belsym-common-bundle)
```

###  Alternatives

[teepluss/asset

Laravel 4 Assets Manage

212.9k](/packages/teepluss-asset)[pixelalbatross/slider-block

132.2k](/packages/pixelalbatross-slider-block)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
