ReactionType
ReactionType
model describes how Reacter
reacted to Reactant
.
Instantiate reaction type from name
$reactionType = ReactionType::fromName('Like');
Get type name
$typeName = $reactionType->getName(); // 'Like'
Get type mass
$typeMass = $reactionType->getMass(); // 1
Determine types equality
$likeType = ReactionType::fromName('Like');
$dislikeType = ReactionType::fromName('Dislike');
$isEqual = $likeType->isEqualTo($likeType); // true
$isEqual = $likeType->isEqualTo($dislikeType); // false
$isNotEqual = $likeType->isNotEqualTo($likeType); // false
$isNotEqual = $likeType->isNotEqualTo($dislikeType); // true
Updated about 5 years ago