<?php

namespace Server\Controllers\Filters;

class ApiFilter
{

    public function apiCreate($body)
    {
        return $body;
    }

    public function apiUpdate($body)
    {
        return $body;
    }

    protected function filter($body, $keysWhitelist)
    {
        return array_filter($body, function ($item, $key) use ($keysWhitelist) {
            return in_array($key, $keysWhitelist);
        }, ARRAY_FILTER_USE_BOTH);
    }
}
