Code Duplication    Length = 13-13 lines in 2 locations

app/Libraries/Metaable/HasMeta.php 1 location

@@ 58-70 (lines=13) @@
55
     * @param null $group
56
     * @return mixed
57
     */
58
    public function updateMeta($meta, $meta_data, $group = null)
59
    {
60
        if(is_numeric($meta))
61
            $meta = $this->getRepository()->getModel()->find((int) $meta)->first();
62
63
        $meta->key   = $meta_data['key'];
64
        $meta->value = $meta_data['value'];
65
        if(isset($group))
66
            $meta->group = $group;
67
68
        $meta->save();
69
        return $meta;
70
    }
71
72
    /**
73
     * Delete meta.

app/Libraries/MetaablePrice/HasMeta.php 1 location

@@ 58-70 (lines=13) @@
55
     * @param null $group
56
     * @return mixed
57
     */
58
    public function updateMeta($meta, $key, $value, $group = null)
59
    {
60
        if(is_numeric($meta))
61
            $meta = $this->getRepository()->getModel()->find((int) $meta)->first();
62
63
        $meta->key = $key;
64
        $meta->value = $value;
65
        if(isset($group))
66
            $meta->group = $group;
67
68
        $meta->save();
69
        return $meta;
70
    }
71
72
    /**
73
     * Delete meta.