Neos\Flow\I18n\Xliff\XliffModel::injectCache PHP Метод

injectCache() публичный Метод

Injects the Flow_I18n_XmlModelCache cache
public injectCache ( Neos\Cache\Frontend\VariableFrontend $cache ) : void
$cache Neos\Cache\Frontend\VariableFrontend
Результат void
    public function injectCache(VariableFrontend $cache)
    {
        $this->cache = $cache;
    }

Usage Example

 /**
  * @test
  */
 public function sourceIsReturnedWhenIdProvidedAndSourceEqualsTargetLanguage()
 {
     $this->model = new I18n\Xliff\XliffModel('foo', new I18n\Locale('en_US'));
     $this->model->injectCache($this->mockCache);
     $this->model->injectParser($this->mockXliffParser);
     $this->model->initializeObject();
     $result = $this->model->getTargetByTransUnitId('key3');
     $this->assertEquals('No target', $result);
 }