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. [Utility &amp; Helpers](/categories/utility)
4. /
5. positibe/content-aware

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

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 4w 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 31% 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

3373d 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.4k129.0M198](/packages/willdurand-negotiation)[mtownsend/read-time

A PHP package to show users how long it takes to read content.

281641.8k2](/packages/mtownsend-read-time)[h5p/h5p-core

H5P Core functionality in PHP

1461.6M38](/packages/h5p-h5p-core)[j0k3r/php-readability

Automatic article extraction from HTML

184892.5k6](/packages/j0k3r-php-readability)[ichhabrecht/content-defender

Define allowed or denied content element types in your backend layouts

903.1M24](/packages/ichhabrecht-content-defender)[h5p/h5p-editor

H5P Editor functionality in PHP

791.6M32](/packages/h5p-h5p-editor)

PHPackages © 2026

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