protected function _input($data, $filter = true)
    {
        // validates input
        if (is_array($filter)) {
            $data = array_intersect_key($data, array_flip($filter));
        }

        unset($data['id']);
        unset($data['_id']);
        unset($data['user_id']);
        unset($data['user']);

        return $data;
    }
protected function _input($data, $filter = true)
    {
        // validates input
        if (is_array($filter)) {
            $data = array_intersect_key($data, array_flip($filter));
        }

        unset($data['id']);
        unset($data['_id']);
        unset($data['user_id']);
        unset($data['user']);

        return $data;
    }
protected function _input ( $ data , $ filter = true ) { // validates input if ( is_array ( $ filter ) ) { $ data = array_intersect_key ( $ data , array_flip ( $ filter ) ) ; } unset ( $ data [ 'id' ] ) ; unset ( $ data [ '_id' ] ) ; unset ( $ data [ 'user_id' ] ) ; unset ( $ data [ 'user' ] ) ; return $ data ; }
Filtering input data.

@param array $data
@param bool $filter

@return array
Filtering input data .