Code Duplication    Length = 9-9 lines in 2 locations

src/ORM/DataObject.php 2 locations

@@ 1886-1894 (lines=9) @@
1883
     *        the field data stripped off. It defaults to TRUE.
1884
     * @return string|array
1885
     */
1886
    public function belongsTo($classOnly = true)
1887
    {
1888
        $belongsTo = (array)$this->config()->get('belongs_to');
1889
        if ($belongsTo && $classOnly) {
1890
            return preg_replace('/(.+)?\..+/', '$1', $belongsTo);
1891
        } else {
1892
            return $belongsTo ? $belongsTo : array();
1893
        }
1894
    }
1895
1896
    /**
1897
     * Gets the class of a one-to-many relationship. If no $component is specified then an array of all the one-to-many
@@ 1904-1912 (lines=9) @@
1901
     *        the field data stripped off. It defaults to TRUE.
1902
     * @return string|array|false
1903
     */
1904
    public function hasMany($classOnly = true)
1905
    {
1906
        $hasMany = (array)$this->config()->get('has_many');
1907
        if ($hasMany && $classOnly) {
1908
            return preg_replace('/(.+)?\..+/', '$1', $hasMany);
1909
        } else {
1910
            return $hasMany ? $hasMany : array();
1911
        }
1912
    }
1913
1914
    /**
1915
     * Return the many-to-many extra fields specification.