diff options
Diffstat (limited to 'www/wiki/extensions/SemanticMediaWiki/src/Query/ProfileAnnotators/FormatProfileAnnotator.php')
-rw-r--r-- | www/wiki/extensions/SemanticMediaWiki/src/Query/ProfileAnnotators/FormatProfileAnnotator.php | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticMediaWiki/src/Query/ProfileAnnotators/FormatProfileAnnotator.php b/www/wiki/extensions/SemanticMediaWiki/src/Query/ProfileAnnotators/FormatProfileAnnotator.php new file mode 100644 index 00000000..8ba1ced4 --- /dev/null +++ b/www/wiki/extensions/SemanticMediaWiki/src/Query/ProfileAnnotators/FormatProfileAnnotator.php @@ -0,0 +1,47 @@ +<?php + +namespace SMW\Query\ProfileAnnotators; + +use SMW\DIProperty; +use SMW\Query\ProfileAnnotator; +use SMWDIBlob as DIBlob; + +/** + * @license GNU GPL v2+ + * @since 1.9 + * + * @author mwjames + */ +class FormatProfileAnnotator extends ProfileAnnotatorDecorator { + + /** + * @var string + */ + private $format; + + /** + * @since 1.9 + * + * @param ProfileAnnotator $profileAnnotator + * @param string $format + */ + public function __construct( ProfileAnnotator $profileAnnotator, $format ) { + parent::__construct( $profileAnnotator ); + $this->format = $format; + } + + /** + * ProfileAnnotatorDecorator::addPropertyValues + */ + protected function addPropertyValues() { + $this->addQueryFormat( $this->format ); + } + + private function addQueryFormat( $format ) { + $this->getSemanticData()->addPropertyObjectValue( + new DIProperty( '_ASKFO' ), + new DIBlob( $format ) + ); + } + +} |