GraphAware\Reco4PHP\Tests\Example\Filter\ExcludeOldMovies::doInclude PHP Method

doInclude() public method

public doInclude ( GraphAware\Common\Type\Node $input, GraphAware\Common\Type\Node $item )
$input GraphAware\Common\Type\Node
$item GraphAware\Common\Type\Node
    public function doInclude(Node $input, Node $item)
    {
        $title = $item->value("title");
        preg_match('/(?:\\()\\d+(?:\\))/', $title, $matches);
        if (isset($matches[0])) {
            $y = str_replace('(', '', $matches[0]);
            $y = str_replace(')', '', $y);
            $year = (int) $y;
            if ($year < 1999) {
                return false;
            }
            return true;
        }
        return false;
    }
ExcludeOldMovies