PHPackages                             kyoushu/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. kyoushu/common-bundle

AbandonedSymfony-bundle

kyoushu/common-bundle
=====================

1.0.0(10y ago)0143MITPHPPHP &gt;=5.5.0

Since Mar 16Pushed 10y ago2 watchersCompare

[ Source](https://github.com/Kyoushu/CommonBundle)[ Packagist](https://packagist.org/packages/kyoushu/common-bundle)[ RSS](/packages/kyoushu-common-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (11)Versions (2)Used By (0)

Kyoushu/CommonBundle
====================

[](#kyoushucommonbundle)

[![Build Status](https://camo.githubusercontent.com/8c473ccddf83c631f121de5c1f8b507351a64762ecb3c75c93dfe3051a4f57ed/68747470733a2f2f7472617669732d63692e6f72672f4b796f757368752f436f6d6d6f6e42756e646c652e737667)](https://travis-ci.org/Kyoushu/CommonBundle)

This file has been generated automatically. It will require editing to reflect describe functionality provided by this bundle.

Installation
------------

[](#installation)

Install [stof/doctrine-extensions-bundle](https://packagist.org/packages/stof/doctrine-extensions-bundle)

Add the following lines to composer.json

```
"require": {
    "kyoushu/common-bundle": "dev-master"
}
```

Add the following line to app/AppKernel.php

```
$bundles = array(
    // ...
    new Kyoushu\CommonBundle\KyoushuCommonBundle(),
    // ...
);
```

Todo
----

[](#todo)

- Documentation for dynamic routes
- Documentation for videos and video metadata

Upload Handler
--------------

[](#upload-handler)

The bundle provides an upload handler which will copy uploaded files to a target directory on update/persist.

All you need to do is implement Kyoushu\\CommonBundle\\Upload\\UploadInterface in your entity.

```
namespace AppBundle\Entity;

use Kyoushu\CommonBundle\Upload\UploadInterface;
use Symfony\Component\HttpFoundation\File\File;

class MyUploadEntity implements UploadInterface
{

    /**
     * @var File|null
     */
    protected $file;

    /**
     * @var string|null
     */
    protected $relPath;

    /**
     * @return File|null
     */
    public function getFile()
    {
        return $this->file;
    }

    /**
     * @param File|null $file
     * @return $this
     */
    public function setFile(File $file = null)
    {
        $this->file = $file;
        return $this;
    }

    /**
     * @return string|null
     */
    public function getRelPath()
    {
        return $this->relPath;
    }

    /**
     * @param string|null $relPath
     * @return $this
     */
    public function setRelPath($relPath)
    {
        $this->relPath = $relPath;
        return $this;
    }

    /**
     * @return string
     */
    public function getRelDir()
    {
        return 'sub/dir/where/upload/should/go';
    }

}
```

Entity Traits
-------------

[](#entity-traits)

The bundle provides a range of traits to speed up the creation of entities

```
namespace AppBundle\Entity;

use Kyoushu\CommonBundle\Entity\Traits as EntityTraits;

class MyEntity
{

    // Provides the property $id (auto-incrementing primary key) and related getter
    use EntityTraits\IdTrait;

    // Provides the properties $title and $slug and related getters/setters
    // - $slug is generated from the value of $title on persist/update
    use EntityTraits\TitleSlugTrait;

    // Provides the $summary property and related getters/setters
    // - Intended to be used with textarea form fields
    use EntityTraits\SummaryTrait;

    // Provides $created and $updated timestamp properties and related getters/setters
    // - $created is set to \DateTime('now') on persist
    // - $updated is set to \DateTime('now') on persist/update
    use EntityTraits\TimestampTrait;

}
```

Entity Finders
--------------

[](#entity-finders)

You can create an entity finder by extending the class \\Kyoushu\\CommonBundle\\EntityFinder\\AbstractEntityFinder

```
namespace AppBundle\EntityFinder;

use Kyoushu\CommonBundle\EntityFinder\AbstractEntityFinder;

class MyEntityFinder extends AbstractEntityFinder
{

    public function getEntityClass()
    {
        return 'AppBundle\Entity\MyEntity';
    }

}
```

Custom parameters can be used by overriding configureQueryBuilder() and getRouteParameterKeys()

```
namespace AppBundle\EntityFinder;

use Kyoushu\CommonBundle\EntityFinder\AbstractEntityFinder;

class MyEntityFinder extends AbstractEntityFinder
{

    protected $title;

    public function getEntityClass()
    {
        return 'AppBundle\Entity\MyEntity';
    }

    public function getTitle()
    {
        return $this->title;
    }

    public function setTitle($title)
    {
        $this->title = $title;
        return $this;
    }

    public function getRouteParameterKeys()
    {
        return array('page', 'perPage', 'title');
    }

    public function configureQueryBuilder(QueryBuilder $queryBuilder)
    {
        $title = $this->getTitle();
        if($title !== null){
            $queryBuilder->andWhere('entity.title like :like_title');
            $queryBuilder->setParameter('like_title', '%' . $title . '%');
        }
    }

}
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3706d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9a3b4f2acc5f46d8ce4639b0f5a3548d75a6de9f12643869c284175a64cc0cc2?d=identicon)[Kyoushu](/maintainers/Kyoushu)

---

Top Contributors

[![Kyoushu](https://avatars.githubusercontent.com/u/535916?v=4)](https://github.com/Kyoushu "Kyoushu (27 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M647](/packages/sylius-sylius)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k16.7M309](/packages/easycorp-easyadmin-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[contao/core-bundle

Contao Open Source CMS

1231.6M2.3k](/packages/contao-core-bundle)

PHPackages © 2026

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