ride/app-orm-behaviour-publish

Publish behaviour for the Ride ORM.

1.0.2 2018-04-27 11:18 UTC

This package is auto-updated.

Last update: 2024-09-13 00:08:12 UTC


README

Publish behaviour of the ORM in a Ride application.

This will add a boolean isPublished field to set the state. Optionally you can use the datePublishedFrom and datePublishedTill datetime fields to specify the publication.

A method isPublishedEntry($date = null) should be used to check if the entry is published.

To enable, add behaviour.publish model option and set it to true.

models.xml

<?xml version="1.0" encoding="UTF-8"?>
<models>
    <model name="Post">
        <field name="title" type="string">
            <validation name="required"/>
        </field>
        <field name="teaser" type="wysiwyg" localized="true">
            <validation name="required"/>
        </field>

        <format name="title">{title}</format>
        <format name="teaser">{teaser}</format>

        <option name="behaviour.publish" value="true" />
    </model>
</models>

Related Modules

Installation

You can use Composer to install this application.

composer require ride/app-orm-behaviour-publish