ae777404637be732683c85f2c269cf2f7cc99844
[Packages/TYPO3.CMS.git] / typo3 / sysext / linkvalidator / Classes / Linktype / AbstractLinktype.php
1 <?php
2 namespace TYPO3\CMS\Linkvalidator\Linktype;
3
4 /***************************************************************
5 * Copyright notice
6 *
7 * (c) 2010 - 2013 Michael Miousse (michael.miousse@infoglobe.ca)
8 * All rights reserved
9 *
10 * This script is part of the TYPO3 project. The TYPO3 project is
11 * free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * The GNU General Public License can be found at
17 * http://www.gnu.org/copyleft/gpl.html.
18 *
19 * This script is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * This copyright notice MUST APPEAR in all copies of the script!
25 ***************************************************************/
26 /**
27 * This class provides Check Base plugin implementation
28 *
29 * @author Michael Miousse <michael.miousse@infoglobe.ca>
30 */
31 abstract class AbstractLinktype implements \TYPO3\CMS\Linkvalidator\Linktype\LinktypeInterface {
32
33 /**
34 * Contains parameters needed for the rendering of the error message
35 *
36 * @var array
37 */
38 protected $errorParams = array();
39
40 /**
41 * Base type fetching method, based on the type that softRefParserObj returns
42 *
43 * @param array $value Reference properties
44 * @param string $type Current type
45 * @param string $key Validator hook name
46 * @return string Fetched type
47 */
48 public function fetchType($value, $type, $key) {
49 if ($value['type'] == $key) {
50 $type = $value['type'];
51 }
52 return $type;
53 }
54
55 /**
56 * Set the value of the protected property errorParams
57 *
58 * @param array $value All parameters needed for the rendering of the error message
59 * @return void
60 */
61 protected function setErrorParams($value) {
62 $this->errorParams = $value;
63 }
64
65 /**
66 * Get the value of the private property errorParams
67 *
68 * @return array All parameters needed for the rendering of the error message
69 */
70 public function getErrorParams() {
71 return $this->errorParams;
72 }
73
74 /**
75 * Construct a valid Url for browser output
76 *
77 * @param array $row Broken link record
78 * @return string Parsed broken url
79 */
80 public function getBrokenUrl($row) {
81 return $row['url'];
82 }
83
84 }
85
86
87 ?>