PHPackages                             positibe/publishable - 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/publishable

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

positibe/publishable
====================

A library base for publishable Entities for PositibeLabs Project

0.2.0.0(9y ago)1301MITPHPPHP &gt;=5.3

Since Mar 29Pushed 9y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (2)Used By (1)

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

[](#positibe-publishable-component)

This library provide you some traits to be used in doctrine entities that implement `Symfony\Cmf\Bundle\CoreBundle\Translatable\TranslatableInterface` and `Symfony\Cmf\Bundle\CoreBundle\PublishWorkflow\PublishTimePeriodInterface`.

PublishableTrait
----------------

[](#publishabletrait)

This trait has the default mapping for a Entity that implement `TranslatableInterface`.

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

trait PublishableTrait
{
    /**
     * @var boolean
     *
     * @ORM\Column(name="publishable", type="boolean")
     */
    protected $publishable = true;

    public function isPublishable()
    {
        return $this->publishable;
    }

    public function setPublishable($boolean)
    {
        $this->publishable = $boolean;
    }
}

```

PublishTimePeriodTrait
----------------------

[](#publishtimeperiodtrait)

This trait has the default mapping for a Entity that implement `PublishTimePeriodInterface`.

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

trait PublishTimePeriodTrait
{
    /**
     * @var \DateTime
     *
     * @ORM\Column(name="publish_start_date", type="datetime", nullable=TRUE)
     */
    protected $publishStartDate;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="publish_end_date", type="datetime", nullable=TRUE)
     */
    protected $publishEndDate;

    public function setPublishStartDate(\DateTime $startDate = null)
    {
        $this->publishStartDate = $startDate;
    }

    public function getPublishStartDate()
    {
        return $this->publishStartDate;
    }

    public function setPublishEndDate(\DateTime $endDate = null)
    {
        $this->publishEndDate = $endDate;
    }

    public function getPublishEndDate()
    {
        return $this->publishEndDate;
    }
}

```

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

[](#using-php-trait)

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

```
[php]
namespace Blog\Entity;

use Symfony\Cmf\Bundle\CoreBundle\PublishWorkflow\PublishTimePeriodInterface;
use Symfony\Cmf\Bundle\CoreBundle\PublishWorkflow\PublishableInterface;
use Positibe\Component\Publishable\Entity\PublishableTrait;
use Positibe\Component\Publishable\Entity\PublishTimePeriodTrait;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Table()
 * @ORM\Entity
 */
class Post implement PublishableInterface, PublishTimePeriodInterface
{
    use PublishableTrait;
    use PublishTimePeriodTrait;
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;
}

```

Note how you don't need to create anything to implement those interfaces.

**Caution:** To use the trait system you need to use PHP &gt; 5.4.

**Important:** This library has not direct dependency of symfony-cmf/core-bundle, so you can use it without this one and need to be installed to use the interfaces.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity48

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

3333d 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 (2 commits)")

---

Tags

publishablepositibelabspositibetime period

### Embed Badge

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

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

PHPackages © 2026

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