Download the PHP package willdurand/propel-publishable-behavior without Composer
On this page you can find all versions of the php package willdurand/propel-publishable-behavior. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package propel-publishable-behavior
PublishableBehavior
The PublishableBehavior is designed to quickly add publish/unpublish features to your model.
Installation
Install the behavior in your project, the recommended way is to use Composer:
Add the following line to your propel.ini
or build.properties
configuration file:
Note:
vendor.willdurand.propel-publishable-behavior.src
is the path of the behavior in dot-path notation.
Usage
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
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
Note: Parameter
include_unpublished
allows you to exclude unpublished object from each query. It is setup tofalse
by default. If you don't want to exclude unpublished items, you have to set it totrue
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
All green?
Credits
- William Durand [email protected]
- Julien Muetton [email protected]