You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each resource model should define a method bool isA(string $class, string $id, $resourceObject = null)
also each resource model should define zero or more classes
In this way we can have a standard method to check the definitions and the criteria for each resource's classes (and/or states).
The resource model is responsible to implement isA method in order to return true or false for each of the available classes.
Examples:
<?php$isAdministrator = User::isA('ADMINISTRATOR', $user->id);
$isNotAdministrator = !User::isA('ADMINISTRATOR', $user->id, $user);
//if $resourceObject argument is available and provided we can eliminate call to resource model's `getById` method,//isA` may require to make additional calls (meta etc) to fetch all required data to reach a decision about a certain class.
The text was updated successfully, but these errors were encountered:
Each resource model should define a method
bool isA(string $class, string $id, $resourceObject = null)
also each resource model should define zero or more classes
literal values of the classes can be constants
In this way we can have a standard method to check the definitions and the criteria for each resource's classes (and/or states).
The resource model is responsible to implement
isA
method in order to returntrue
orfalse
for each of the available classes.Examples:
The text was updated successfully, but these errors were encountered: