kohana/core — pull request #368 by danieliser (2013-07-02 01:34:11+00:00)
Title: Added function Arr::filter()

Similar to extract except that it doesnt return keys that arnt set in the first array.

EX..
Arr::filter(
array('a' => 'foo', 'b' => 'bar'),
array('a','c')
);
Returns array('a' => 'foo')
Key b is removed from results altogether.

This is particularly useful for extracting fields from $_POST for Model without leaveing unset values as NULL.
Regular extract in this situation will end up saving value "C" above as NULL even if your only attempting to change "A".