openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

FileHistoryGenerator.class.php (751B)


      1 <?php
      2 
      3 
      4 namespace cms\generator;
      5 
      6 
      7 use cms\generator\filter\AbstractFilter;
      8 use cms\model\File;
      9 use cms\model\Value;
     10 use logger\Logger;
     11 use util\exception\GeneratorException;
     12 
     13 class FileHistoryGenerator extends FileGenerator
     14 {
     15 	/**
     16 	 * @param $fileContext FileHistoryContext
     17 	 */
     18 	public function __construct($fileContext )
     19 	{
     20 		parent::__construct( $fileContext );
     21 	}
     22 
     23 
     24 	/**
     25 	 * Generate value in the wished version.
     26 	 * @return string
     27 	 */
     28 	protected function generate()
     29 	{
     30 		$value = new Value();
     31 		$value->loadWithId( $this->context->valueId);
     32 
     33 		return $value->file; // Should we filter here?
     34 	}
     35 
     36 
     37 	/**
     38 	 * Not useful: FileHistory will only be used in the preview.
     39 	 * @return null
     40 	 */
     41 	public function getPublicFilename()
     42 	{
     43 		return null;
     44 	}
     45 }