PHPackages                             positibe/content-aware - 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. positibe/content-aware

ActiveLibrary

positibe/content-aware
======================

A library base for content aware entities for PositibeLabs Project

0.1.1.0(9y ago)015MITPHP

Since Apr 5Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Positibe/ContentAware)[ Packagist](https://packagist.org/packages/positibe/content-aware)[ Docs](http://positibelabs.blogspot.com/component/content-aware)[ RSS](/packages/positibe-content-aware/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Positibe Publishable Component
==============================

[](#positibe-publishable-component)

This library provide you some traits to be used in doctrine entities that implement some system of entity that has some content but has not relation with them. Also provide some interfaces for repositories to create a common management of content aware.

ContentClassAwareTrait
----------------------

[](#contentclassawaretrait)

```
[php]
namespace Positibe\Component\ContentAware\Entity;

trait ContentClassAwareTrait {

    /**
     * @var string
     *
     * @ORM\Column(name="content_class", type="string", length=128, nullable=TRUE)
     */
    protected $contentClass;

    public function setContentClassByContent($content)
    {
        $this->contentClass = get_class($content);
    }

    /**
     * @return string
     */
    public function getContentClass()
    {
        return $this->contentClass;
    }

    /**
     * @param string $contentClass
     */
    public function setContentClass($contentClass)
    {
        $this->contentClass = $contentClass;
    }
}

```

ContentAwareTrait
-----------------

[](#contentawaretrait)

```
[php]
namespace Positibe\Component\ContentAware\Entity;

trait ContentAwareTrait
{
    protected $content;
    use ContentClassAwareTrait;

    public function setContent($content)
    {
        $this->content = $content;
        $this->setContentClassByContent($content);
    }

    public function getContent()
    {
        return $this->content;
    }
}

```

ContentAwareInterface
---------------------

[](#contentawareinterface)

This interface is only to know if Repository is of the ContentAware entities

```
[php]
namespace Positibe\Component\ContentAware\Model;

interface ContentAwareInterface
{

}

```

ContentAwareRepositoryInterface
-------------------------------

[](#contentawarerepositoryinterface)

```
[php]
namespace Positibe\Component\ContentAware\Model;

interface ContentAwareRepositoryInterface
{
    public function findContent($object);
}

```

Using php trait
---------------

[](#using-php-trait)

These are simple php traits so you can use it like that.

```
[php]
namespace Blog\Entity;

use Doctrine\ORM\Mapping as ORM;
use Positibe\Component\ContentAware\Entity\ContentClassAwareTrait;
use Positibe\Component\ContentAware\Model\ContentAwareInterface;

/**
 * @ORM\Table()
 * @ORM\Entity
 */
class Tags implements ContentAwareInterface
{
    use ContentClassAwareTrait;

    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;
}

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

3326d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7a0a4509b3c113e5160b4f3f7708a1ead7bc99b2b33ebe4c1e3b59c14b6e530d?d=identicon)[pcabreus](/maintainers/pcabreus)

---

Top Contributors

[![pcabreus](https://avatars.githubusercontent.com/u/8780578?v=4)](https://github.com/pcabreus "pcabreus (1 commits)")

---

Tags

contentpositibelabspositibecontent aware

### Embed Badge

![Health badge](/badges/positibe-content-aware/health.svg)

```
[![Health](https://phpackages.com/badges/positibe-content-aware/health.svg)](https://phpackages.com/packages/positibe-content-aware)
```

###  Alternatives

[willdurand/negotiation

Content Negotiation tools for PHP provided as a standalone library.

1.4k122.0M157](/packages/willdurand-negotiation)[coldtrick/thewire_tools

Extend the functionality of The Wire

133.2k](/packages/coldtrick-thewire-tools)

PHPackages © 2026

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