You are here

function crumbs_MultiPlugin_EntityFindSomething::initWeights in Crumbs, the Breadcrumbs suite 7.2

Parameters

crumbs_Container_WeightMap $localWeightMap:

File

lib/MultiPlugin/EntityFindSomething.php, line 53

Class

crumbs_MultiPlugin_EntityFindSomething

Code

function initWeights($localWeightMap) {
  if ('user' !== $this->entityType) {
    return;
  }
  foreach (user_roles(TRUE) as $rid => $role) {
    $weight = $localWeightMap
      ->valueAtKey($role);
    if (FALSE !== $weight) {
      $this->weights[$rid] = $weight;
    }
  }
  asort($this->weights);
}