ElggMenuItem::getData PHP Method

getData() public method

Get stored data
public getData ( string $key ) : mixed
$key string The key for the requested key/value pair
return mixed
    public function getData($key)
    {
        if (isset($this->data[$key])) {
            return $this->data[$key];
        } else {
            return null;
        }
    }

Usage Example

Beispiel #1
0
 /**
  * Compare two menu items by their priority
  *
  * @param ElggMenuItem $a Menu item
  * @param ElggMenuItem $b Menu item
  * @return bool
  *
  * @todo change name to compareByPriority
  */
 public static function compareByWeight($a, $b)
 {
     $aw = $a->getWeight();
     $bw = $b->getWeight();
     if ($aw == $bw) {
         return $a->getData('original_order') - $b->getData('original_order');
     }
     return $aw - $bw;
 }
All Usage Examples Of ElggMenuItem::getData