Code Duplication    Length = 12-13 lines in 2 locations

model/DataObject.php 2 locations

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