App\Services\Repositories\OptionRepository::only PHP Method

only() public method

Return the options with key in the given array.
public only ( array $array ) : array
$array array
return array
    public function only(array $array)
    {
        $result = [];
        foreach ($this->items as $key => $value) {
            if (in_array($key, $array)) {
                $result[$key] = $value;
            }
        }
        return $result;
    }