Code Duplication    Length = 18-19 lines in 2 locations

model/fieldtypes/Text.php 1 location

@@ 39-56 (lines=18) @@
36
 	 * (non-PHPdoc)
37
 	 * @see DBField::requireField()
38
 	 */
39
	public function requireField() {
40
		$charset = Config::inst()->get('MySQLDatabase', 'charset');
41
		$collation = Config::inst()->get('MySQLDatabase', 'collation');
42
43
		$parts = array(
44
			'datatype' => 'mediumtext',
45
			'character set' => $charset,
46
			'collate' => $collation,
47
			'arrayValue' => $this->arrayValue
48
		);
49
50
		$values= array(
51
			'type' => 'text',
52
			'parts' => $parts
53
		);
54
55
		DB::require_field($this->tableName, $this->name, $values, $this->default);
56
	}
57
58
	/**
59
	 * Return the value of the field with relative links converted to absolute urls.

model/fieldtypes/Varchar.php 1 location

@@ 52-70 (lines=19) @@
49
 	 * (non-PHPdoc)
50
 	 * @see DBField::requireField()
51
 	 */
52
	public function requireField() {
53
		$charset = Config::inst()->get('MySQLDatabase', 'charset');
54
		$collation = Config::inst()->get('MySQLDatabase', 'collation');
55
56
		$parts = array(
57
			'datatype'=>'varchar',
58
			'precision'=>$this->size,
59
			'character set'=> $charset,
60
			'collate'=> $collation,
61
			'arrayValue'=>$this->arrayValue
62
		);
63
64
		$values = array(
65
			'type' => 'varchar',
66
			'parts' => $parts
67
		);
68
69
		DB::require_field($this->tableName, $this->name, $values);
70
	}
71
72
	/**
73
	 * Return the first letter of the string followed by a .