2017 © Pedro PelĂĄez
 

cakephp-plugin cakephp-readable-behavior

CakePHP ReadableBehavior provides a simple behavior to make a 'Mark as Read/Unread' feature for your models

image

aschelch/cakephp-readable-behavior

CakePHP ReadableBehavior provides a simple behavior to make a 'Mark as Read/Unread' feature for your models

  • Wednesday, June 19, 2013
  • by aschelch
  • Repository
  • 2 Watchers
  • 3 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

CakePHP Readable Behavior

CakePHP ReadableBehavior provides a simple behavior to make a "Mark as Read/Unread" feature for your models, (*1)

Installation

Download the plugin, (*2)

cd app/Plugin
git clone git://github.com/aschelch/cakephp-readable-behavior.git Readable

Attach the Readable behavior to the model, (*3)

public Post extends AppModel{
    $actsAs = array('Readable.Readable');
}

Add a 'read' boolean column in your table or change the default field name, (*4)

public Post extends AppModel{
    $actsAs = array('Readable.Readable' => array(
        'field' => 'displayed'
    ));
}

Usage

Mark a post as read using id, (*5)

$this->Post->markAsRead(1);

Mark multiple posts as read using a array of id, (*6)

$this->Post->markAsRead(array(1,2,3));

Mark a post as unread using id, (*7)

$this->Post->markAsUnread(1);

Mark multiple posts as unread using a array of id, (*8)

$this->Post->markAsUnread(array(1,2,3));

Mark all posts using a condition as read, (*9)

$this->Post->markAllAsRead(array('Post.user_id'=>1));

Mark all posts using a condition as unread, (*10)

$this->Post->markAllAsUnread(array('Post.user_id'=>1));

The Versions

19/06 2013

1.0.x-dev

1.0.9999999.9999999-dev https://github.com/aschelch/cakephp-readable-behavior

CakePHP ReadableBehavior provides a simple behavior to make a 'Mark as Read/Unread' feature for your models

  Sources   Download

The Requires

 

cakephp behavior

19/06 2013

dev-master

9999999-dev https://github.com/aschelch/cakephp-readable-behavior

CakePHP ReadableBehavior provides a simple behavior to make a 'Mark as Read/Unread' feature for your models

  Sources   Download

The Requires

 

cakephp behavior

19/06 2013

v1.0.0

1.0.0.0 https://github.com/aschelch/cakephp-readable-behavior

CakePHP ReadableBehavior provides a simple behavior to make a 'Mark as Read/Unread' feature for your models

  Sources   Download

The Requires

 

cakephp behavior