You are here

function crumbs_Container_WildcardData::getAll in Crumbs, the Breadcrumbs suite 7.2

Determine the values for the key and all wildcard parents.

Parameters

string $key: The key

Return value

array The values, e.g. aaa.bbb.ccc.ddd => 5 aaa.bbb.ccc.* => 77 aaa.* => 21

  • => 9
1 call to crumbs_Container_WildcardData::getAll()
crumbs_Container_WildcardData::getAllMerged in lib/Container/WildcardData.php
If the values are arrays, then this one merges the array values for the key and all wildcard parents.

File

lib/Container/WildcardData.php, line 37

Class

crumbs_Container_WildcardData

Code

function getAll($key) {
  $fragments = explode('.', $key);
  $partial_key = array_shift($fragments);
  $values = array();
  while (!empty($fragments)) {
    $wildcard_key = $partial_key . '.*';
    if (isset($this->data[$wildcard_key])) {
      $values[$wildcard_key] = $this->data[$wildcard_key];
    }
    $partial_key .= '.' . array_shift($fragments);
  }
  if (isset($this->data[$key])) {
    $values[$key] = $this->data[$key];
  }
  return array_reverse($values);
}