Aerospike\LDT\LList::scan PHP Method

scan() public method

An optional UDF filter function can be applied to the elements found. The filter function returns nil to filter out the element, otherwise it may transform the element before returning it.
public scan ( array &$elements, string | null $module = null, string | null $function = null, array $args = [] ) : integer
$elements array returned
$module string | null the name of the UDF module containing the optional filter function
$function string | null name of the UDF filter function to apply
$args array optional arguments for the filter function, passed as a map to the filter function
return integer status code of the operation
    public function scan(&$elements, $module = null, $function = null, array $args = array())
    {
        $elements = array();
        if (!is_null($module) && !is_null($function)) {
            $status = $this->client->apply($this->key, 'llist', 'filter', array($this->bin, null, $module, $function, $args), $elements);
        } else {
            $status = $this->client->apply($this->key, 'llist', 'scan', array($this->bin), $elements);
        }
        $this->processStatusCode($status);
        return $this->errorno;
    }