summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Validator/src/ParamProcessor/MediaWikiTitleValue.php')
-rw-r--r--Validator/src/ParamProcessor/MediaWikiTitleValue.php105
1 files changed, 0 insertions, 105 deletions
diff --git a/Validator/src/ParamProcessor/MediaWikiTitleValue.php b/Validator/src/ParamProcessor/MediaWikiTitleValue.php
deleted file mode 100644
index d8f4e708..00000000
--- a/Validator/src/ParamProcessor/MediaWikiTitleValue.php
+++ /dev/null
@@ -1,105 +0,0 @@
-<?php
-
-namespace ParamProcessor;
-
-use DataValues\DataValueObject;
-use InvalidArgumentException;
-use Title;
-
-/**
- * @licence GNU GPL v2+
- * @author Jeroen De Dauw < jeroendedauw@gmail.com >
- */
-class MediaWikiTitleValue extends DataValueObject {
-
- /**
- * @since 0.1
- *
- * @var Title
- */
- protected $title;
-
- /**
- * @since 0.1
- *
- * @param Title $title
- *
- * @throws InvalidArgumentException
- */
- public function __construct( Title $title ) {
- $this->title = $title;
- }
-
- /**
- * @see Serializable::serialize
- *
- * @since 0.1
- *
- * @return string
- */
- public function serialize() {
- return $this->title->getFullText();
- }
-
- /**
- * @see Serializable::unserialize
- *
- * @since 0.1
- *
- * @param string $value
- *
- * @return MediaWikiTitleValue
- */
- public function unserialize( $value ) {
- $this->__construct( Title::newFromText( $value ) );
- }
-
- /**
- * @see DataValue::getType
- *
- * @since 0.1
- *
- * @return string
- */
- public static function getType() {
- return 'mediawikititle';
- }
-
- /**
- * @see DataValue::getSortKey
- *
- * @since 0.1
- *
- * @return string|float|int
- */
- public function getSortKey() {
- return $this->title->getCategorySortkey();
- }
-
- /**
- * Returns the Title object.
- * @see DataValue::getValue
- *
- * @since 0.1
- *
- * @return Title
- */
- public function getValue() {
- return $this->title;
- }
-
- /**
- * Constructs a new instance of the DataValue from the provided data.
- * This can round-trip with @see getArrayValue
- *
- * @since 0.1
- *
- * @param mixed $data
- *
- * @return MediaWikiTitleValue
- */
- public static function newFromArray( $data ) {
- return new static( $data );
- }
-
-} \ No newline at end of file