Code Duplication    Length = 12-13 lines in 2 locations

model/DataObject.php 2 locations

@@ 1825-1836 (lines=12) @@
1822
	 * @return string|array The class of the one-to-one component, or an array of all one-to-one components and
1823
	 * 							their classes.
1824
	 */
1825
	public function hasOne($component = null) {
1826
		if($component) {
1827
			Deprecation::notice(
1828
				'4.0',
1829
				'Please use DataObject::hasOneComponent() instead of passing a component name to hasOne()',
1830
				Deprecation::SCOPE_GLOBAL
1831
			);
1832
			return $this->hasOneComponent($component);
1833
		}
1834
1835
		return (array)Config::inst()->get($this->class, 'has_one', Config::INHERITED);
1836
	}
1837
1838
	/**
1839
	 * Return data for a specific has_one component.
@@ 2036-2048 (lines=13) @@
2033
	 * @param string $component Deprecated - Name of component
2034
	 * @return array|null
2035
	 */
2036
	public function manyManyExtraFields($component = null) {
2037
		if($component) {
2038
			Deprecation::notice(
2039
				'4.0',
2040
				'Please use DataObject::manyManyExtraFieldsForComponent() instead of passing a component name
2041
					to manyManyExtraFields()',
2042
				Deprecation::SCOPE_GLOBAL
2043
			);
2044
			return $this->manyManyExtraFieldsForComponent($component);
2045
		}
2046
2047
		return Config::inst()->get($this->class, 'many_many_extraFields', Config::INHERITED);
2048
	}
2049
2050
	/**
2051
	 * Return the many-to-many extra fields specification for a specific component.