<?php
// (c) Copyright 2002-2013 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$

namespace Tiki\Command;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

use Tiki\Recommendation\Input\UserInput;
use TikiLib;

class RecommendationBatchCommand extends Command
{
    protected function configure()
    {
        $this
            ->setName('recommendation:batch')
            ->setDescription('Identify and send recommendations');
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
		$batch = TikiLib::lib('recommendationcontentbatch');

		$batch->process([new UserInput('user1')]);
    }
}

<?php
// (c) Copyright 2002-2013 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$

namespace Tiki\Command;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

use Tiki\Recommendation\Input\UserInput;
use TikiLib;

class RecommendationBatchCommand extends Command
{
    protected function configure()
    {
        $this
            ->setName('recommendation:batch')
            ->setDescription('Identify and send recommendations');
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
		$batch = TikiLib::lib('recommendationcontentbatch');
		$userlib = TikiLib::lib('user');

		$list = array_map(function ($user) {
			return new UserInput($user);
		}, $userlib->get_users_names());

		$batch->process($list);
    }
}

Apply batch to all users
[MOD] Apply batch to all users

git-svn-id: a7fabbc6a7c54ea5c67cbd16bd322330fd10cc35@52510 b456876b-0849-0410-b77d-98878d47e9d5
