Habari\Posts::extract_param PHP Method

extract_param() public static method

Extract parameters from a Posts::get()-style param array, even from within where's
public static extract_param ( array $paramarray, string $param ) : array | boolean
$paramarray array An array of Posts::get()-style parameters
$param string The parameters to extract
return array | boolean The parameters in the $paramarray that match $param or false
    public static function extract_param($paramarray, $param)
    {
        $result = array();
        if (isset($paramarray[$param])) {
            $result = array_merge($result, Utils::single_array($paramarray[$param]));
        }
        if (isset($paramarray['where'])) {
            if (is_array($paramarray['where'])) {
                foreach ($paramarray['where'] as $where) {
                    if (isset($where[$param])) {
                        $result = array_merge($result, Utils::single_array($where[$param]));
                    }
                }
            }
        }
        return count($result) ? $result : false;
    }