2017-25 © Pedro Peláez
 

library rate

Multi Purpose Rate System (Supports like, dislike, rate with other numbers or text)

image

mhndev/rate

Multi Purpose Rate System (Supports like, dislike, rate with other numbers or text)

  • Monday, October 9, 2017
  • by majidphpdeveloper
  • Repository
  • 2 Watchers
  • 4 Stars
  • 59 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 13 Versions
  • 4 % Grown

The README.md

Rate System

Supports

1) Like

2) Like (+1), Dislike(-1)

3) Rate with other number(e.x. 0 < rate <= 5 )

4) Rate with string ('good' , 'very good' , ...)

Sample Usage


use mhndev\rate\Abstracts\Entity; use mhndev\rate\DiscreteNumberValue; use mhndev\rate\Interfaces\iRateableEntity; class User { use \mhndev\rate\Traits\UserTrait; /** * @param $value * @param iRateableEntity $entity * @param $type */ function doRate($value, iRateableEntity $entity, $type) { echo 'rate is done in our storage system.'; } } //you can either extend your entity from AbstractEntity class class Post extends Entity { } //or use EntityTrait in your Entity class Post implements iRateableEntity { use \mhndev\rate\Traits\EntityTrait; } class Comment extends Entity { } //or use EntityTrait in your Entity class Comment implements iRateableEntity { use \mhndev\rate\Traits\EntityTrait; } $rateValue = (new DiscreteNumberValue())->setPossibleValues([1,2,3]); $post = (new Post())->setRateValue($rateValue); //or Post::setRateValue($rateValue); $post->setPossibleRateTypes(['like', 'rate']); $rateValue = (new DiscreteNumberValue())->setPossibleValues([-1,1]); $comment = (new Comment())->setRateValue($rateValue); //or Comment::setRateValue($rateValue); // by default possible rate types are "rate" and "like" so if you want your rate types to be just like default you don't need to call setPossibleRateTypes method on entity pbject $post->setPossibleRateTypes(['like', 'rate', 'test']); //or Post::setPossibleRateTypes(['like', 'rate', 'test']); $user = new User; $user->rate(3, $post); $user->like($post); $user->rate(1,$comment); $user->dislike($comment);

The Versions

09/10 2017

dev-master

9999999-dev

Multi Purpose Rate System (Supports like, dislike, rate with other numbers or text)

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

rate rank like dislike unlike

09/10 2017

dev-develop

dev-develop

Multi Purpose Rate System (Supports like, dislike, rate with other numbers or text)

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

rate rank like dislike unlike

09/10 2017

1.0.10

1.0.10.0

Multi Purpose Rate System (Supports like, dislike, rate with other numbers or text)

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

rate rank like dislike unlike

18/10 2016

1.0.9

1.0.9.0

Multi Purpose Rate System (Supports like, dislike, rate with other numbers or text)

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

rate rank like dislike unlike

18/10 2016

1.0.8

1.0.8.0

Multi Purpose Rate System (Supports like, dislike, rate with other numbers or text)

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

rate rank like dislike unlike

02/10 2016

1.0.6

1.0.6.0

Multi Purpose Rate System (Supports like, dislike, rate with other numbers or text)

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

rate rank like dislike unlike

02/10 2016

1.0.7

1.0.7.0

Multi Purpose Rate System (Supports like, dislike, rate with other numbers or text)

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

rate rank like dislike unlike

27/09 2016

1.0.5

1.0.5.0

Multi Purpose Rate System (Supports like, dislike, rate with other numbers or text)

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

rate rank like dislike unlike

25/09 2016

0.1.4

0.1.4.0

Multi Purpose Rate System (Supports like, dislike, rate with other numbers or text)

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

rate rank like dislike unlike

25/09 2016

0.1.3

0.1.3.0

Multi Purpose Rate System (Supports like, dislike, rate with other numbers or text)

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

rate rank like dislike unlike

25/09 2016

0.1.2

0.1.2.0

Multi Purpose Rate System (Supports like, dislike, rate with other numbers or text)

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

rate rank like dislike unlike

25/09 2016

0.1.1

0.1.1.0

Multi Purpose Rate System (Supports like, dislike, rate with other numbers or text)

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

rate rank like dislike unlike

18/05 2016

0.1.0

0.1.0.0

Multi Purpose Rate System (Supports like, dislike, rate with other numbers or text)

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

rate rank like dislike unlike