Caffeinated\Menus\Item::data PHP Метод

data() публичный Метод

Set or get an item's metadata.
public data ( ) : string | Item
Результат string | Item
    public function data()
    {
        $args = func_get_args();
        if (isset($args[0]) and is_array($args[0])) {
            $this->data = array_merge($this->data, array_change_key_case($args[0]));
            return $this;
        } elseif (isset($args[0]) and isset($args[1])) {
            $this->data[strtolower($args[0])] = $args[1];
            return $this;
        } elseif (isset($args[0])) {
            return isset($this->data[$args[0]]) ? $this->data[$args[0]] : null;
        }
        return $this->data;
    }