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