Code Duplication    Length = 11-11 lines in 2 locations

model/DataObject.php 2 locations

@@ 1901-1911 (lines=11) @@
1898
	 *        the field data stripped off. It defaults to TRUE.
1899
	 * @return string|false
1900
	 */
1901
	public function belongsToComponent($component, $classOnly = true) {
1902
		$belongsTo = (array)Config::inst()->get($this->class, 'belongs_to', Config::INHERITED);
1903
1904
		if($belongsTo && array_key_exists($component, $belongsTo)) {
1905
			$belongsTo = $belongsTo[$component];
1906
		} else {
1907
			return false;
1908
		}
1909
1910
		return ($classOnly) ? preg_replace('/(.+)?\..+/', '$1', $belongsTo) : $belongsTo;
1911
	}
1912
1913
	/**
1914
	 * Return all of the database fields defined in self::$db and all the parent classes.
@@ 1999-2009 (lines=11) @@
1996
	 *        the field data stripped off. It defaults to TRUE.
1997
	 * @return string|false
1998
	 */
1999
	public function hasManyComponent($component, $classOnly = true) {
2000
		$hasMany = (array)Config::inst()->get($this->class, 'has_many', Config::INHERITED);
2001
2002
		if($hasMany && array_key_exists($component, $hasMany)) {
2003
			$hasMany = $hasMany[$component];
2004
		} else {
2005
			return false;
2006
		}
2007
2008
		return ($classOnly) ? preg_replace('/(.+)?\..+/', '$1', $hasMany) : $hasMany;
2009
	}
2010
2011
	/**
2012
	 * @deprecated 4.0 Method has been replaced by manyManyExtraFields() and