public static function BookAccess::api in Book access 7.2
Same name and namespace in other branches
- 6.2 book_access.module \BookAccess::api()
Verifies the current API version is included between two values passed as arguments.
Parameters
$minimum: The minimum API version required. If the parameter is not passed, the method will use the constant API_COMPATIBLE_VERSION.
$maximum: The maximum version required. This argument is optional; the current API will be checked against this value only if it is passed to the function.
Return value
TRUE, if the current API version is included between the passed values.
File
- ./
book_access.module, line 133 - Allows to set the access control for book nodes on a per book basis. Based on forum_access.module and tac_lite.module.
Class
- BookAccess
- @file
Code
public static function api($minimum = NULL, $maximum = NULL) {
if (!isset($minimum)) {
$minimum = self::API_COMPATIBLE_VERSION;
}
if (version_compare(self::API_VERSION, $minimum, '<')) {
return FALSE;
}
if (isset($maximum) && version_compare(self::API_VERSION, $maximum, '>')) {
return FALSE;
}
return TRUE;
}