kohana/core — pull request #369 by danieliser (2013-07-04 01:55:27+00:00)
Title: Added function Arr::extract_existing()

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".