public function CategoryStorageManager::getCookieCategoryNextWeight in EU Cookie Compliance (GDPR Compliance) 2.0.x
Same name and namespace in other branches
- 8 src/CategoryStorageManager.php \Drupal\eu_cookie_compliance\CategoryStorageManager::getCookieCategoryNextWeight()
Determine the next highest weight.
Return value
int The next highest weight.
File
- src/
CategoryStorageManager.php, line 50
Class
- CategoryStorageManager
- The cookie category storage manager class.
Namespace
Drupal\eu_cookie_complianceCode
public function getCookieCategoryNextWeight() {
/** @var \Drupal\eu_cookie_compliance\Entity\CookieCategoryInterface[] $cookies */
$cookies = $this
->loadMultiple();
$weight = -10;
foreach ($cookies as $cookie) {
if ($cookie
->getWeight() > $weight) {
$weight = $cookie
->getWeight();
}
}
return $weight + 1;
}