title: Execute repository functions in scheduler task
body: <p>Currently I have an scheduler task, but I want to use function from my extbase repository (in the same extension).</p>
  
  <p>I keep getting "PHP Fatal error:  Call to a member function add() on a non-object", no matter how I try to include my repo or controller from extbase.</p>
  
  <p>My SampleTask.php:</p>
  
  <pre><code>namespace TYPO3\ExtName\Task;
  
  class SampleTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask {
  
      public function execute() {
          $controller = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('\TYPO3\ExtName\Controller\SampleController');
          $new = new \TYPO3\ExtName\Domain\Model\Sample;
          $new-&gt;setName('test');
          $controller-&gt;createAction($new);
      }
  }
  </code></pre>
  
  <p>And correctly defined in my ext_localconf.php</p>
  
  <p>Can someone explain me how I can access my Repository (or controller) -extbase- from my SampleTask.php.</p>
  
  <p>Using TYPO3 6.2.</p>
  
  <p>Thank you.</p>