PHPackages                             willdurand/propel-publishable-behavior - 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. willdurand/propel-publishable-behavior

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

willdurand/propel-publishable-behavior
======================================

1.2.0(12y ago)1020.4k31PHPPHP &gt;=5.2.4

Since May 12Pushed 12y ago1 watchersCompare

[ Source](https://github.com/willdurand/PublishableBehavior)[ Packagist](https://packagist.org/packages/willdurand/propel-publishable-behavior)[ RSS](/packages/willdurand-propel-publishable-behavior/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (2)Versions (6)Used By (1)

PublishableBehavior
===================

[](#publishablebehavior)

[![Build Status](https://camo.githubusercontent.com/e37c1276e029a5d04869e86ea7443ead22deba24fc6a473ef5fa2cb265c067d1/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f77696c6c647572616e642f5075626c69736861626c654265686176696f722e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/willdurand/PublishableBehavior)

The PublishableBehavior is designed to quickly add publish/unpublish features to your model.

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

[](#installation)

Install the behavior in your project, the recommended way is to use Composer:

```
{
    "require": {
        "willdurand/propel-publishable-behavior": "dev-master"
    }
}
```

Add the following line to your `propel.ini` or `build.properties` configuration file:

```
propel.behavior.publishable.class = vendor.willdurand.propel-publishable-behavior.src.PublishableBehavior
```

> Note: `vendor.willdurand.propel-publishable-behavior.src` is the path of the behavior in dot-path notation.

Usage
-----

[](#usage)

### ActiveRecord API

[](#activerecord-api)

Returns true if the object is published, false otherwise:

```
isPublished()

```

Mark an object as published:

```
publish(PropelPDO $con = null)

```

Mark an object as not published:

```
unpublish(PropelPDO $con = null)

```

Has publication frame started ?

```
hasPublicationEnded()

```

Has publication frame started ?

```
hasPublicationStarted()

```

### ActiveQuery API

[](#activequery-api)

Include unpublished objects in the results set:

```
includeUnpublished()

```

Filter by objects not published exclusively:

```
filterUnpublished()

```

Filter by objects published exclusively:

```
filterPublished()

```

Filter by publication active

```
filterByPublicationActive($date = 'now')

```

Mark an object as published:

```
publish(PropelPDO $con = null)

```

Mark an object as not published:

```
unpublish(PropelPDO $con = null)

```

Parameters
----------

[](#parameters)

```

```

> Note: Parameter `include_unpublished` allows you to exclude unpublished object from each query. It is setup to `false` by default. If you don't want to exclude unpublished items, you have to set it to `true`

Running tests
-------------

[](#running-tests)

First of all, copy the `phpunit.xml.dist` to `phpunit.xml`.

If you did not install propel with composer, change `PROPEL_DIR` and `PHING_DIR`values to customize the include path. Customize autoloader by changing `AUTOLOAD` property.

then simply launch

```
$ vendor/bin/phpunit -c phpunit.xml
```

All green?

Credits
-------

[](#credits)

- William Durand
- Julien Muetton [julien\_muetton@carpe-hora.com](mailto:julien_muetton@carpe-hora.com)

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 51.7% 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

Every ~158 days

Total

5

Last Release

4524d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1620075?v=4)[François Ganachaud](/maintainers/couac)[@couac](https://github.com/couac)

---

Top Contributors

[![themouette](https://avatars.githubusercontent.com/u/245501?v=4)](https://github.com/themouette "themouette (15 commits)")[![willdurand](https://avatars.githubusercontent.com/u/217628?v=4)](https://github.com/willdurand "willdurand (11 commits)")[![csanquer](https://avatars.githubusercontent.com/u/372677?v=4)](https://github.com/csanquer "csanquer (2 commits)")[![smirik](https://avatars.githubusercontent.com/u/354907?v=4)](https://github.com/smirik "smirik (1 commits)")

---

Tags

Behaviorpropelpublishable

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/willdurand-propel-publishable-behavior/health.svg)

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

###  Alternatives

[craftyshadow/propel-equalnest-behavior

This behavior provides a way to define relations between objects that have equal hierarchy (friendship).

1531.6k](/packages/craftyshadow-propel-equalnest-behavior)[sjaakp/yii2-taggable

Manage tags of ActiveRecord in Yii2.

3031.8k](/packages/sjaakp-yii2-taggable)[baibaratsky/yii2-serialized-attributes-behavior

Yii2 Serialized Attributes Behavior

1175.1k9](/packages/baibaratsky-yii2-serialized-attributes-behavior)[marqu3s/yii2-behaviors

Collection of Yii2 behaviors

1212.7k](/packages/marqu3s-yii2-behaviors)

PHPackages © 2026

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