|
@@ 1870-1878 (lines=9) @@
|
| 1867 |
|
* the field data stripped off. It defaults to TRUE. |
| 1868 |
|
* @return string|array |
| 1869 |
|
*/ |
| 1870 |
|
public function belongsTo($classOnly = true) |
| 1871 |
|
{ |
| 1872 |
|
$belongsTo = (array)$this->config()->get('belongs_to'); |
| 1873 |
|
if ($belongsTo && $classOnly) { |
| 1874 |
|
return preg_replace('/(.+)?\..+/', '$1', $belongsTo); |
| 1875 |
|
} else { |
| 1876 |
|
return $belongsTo ? $belongsTo : array(); |
| 1877 |
|
} |
| 1878 |
|
} |
| 1879 |
|
|
| 1880 |
|
/** |
| 1881 |
|
* Gets the class of a one-to-many relationship. If no $component is specified then an array of all the one-to-many |
|
@@ 1888-1896 (lines=9) @@
|
| 1885 |
|
* the field data stripped off. It defaults to TRUE. |
| 1886 |
|
* @return string|array|false |
| 1887 |
|
*/ |
| 1888 |
|
public function hasMany($classOnly = true) |
| 1889 |
|
{ |
| 1890 |
|
$hasMany = (array)$this->config()->get('has_many'); |
| 1891 |
|
if ($hasMany && $classOnly) { |
| 1892 |
|
return preg_replace('/(.+)?\..+/', '$1', $hasMany); |
| 1893 |
|
} else { |
| 1894 |
|
return $hasMany ? $hasMany : array(); |
| 1895 |
|
} |
| 1896 |
|
} |
| 1897 |
|
|
| 1898 |
|
/** |
| 1899 |
|
* Return the many-to-many extra fields specification. |