|
@@ 1836-1844 (lines=9) @@
|
| 1833 |
|
* the field data stripped off. It defaults to TRUE. |
| 1834 |
|
* @return string|array |
| 1835 |
|
*/ |
| 1836 |
|
public function belongsTo($classOnly = true) |
| 1837 |
|
{ |
| 1838 |
|
$belongsTo = (array)$this->config()->get('belongs_to'); |
| 1839 |
|
if ($belongsTo && $classOnly) { |
| 1840 |
|
return preg_replace('/(.+)?\..+/', '$1', $belongsTo); |
| 1841 |
|
} else { |
| 1842 |
|
return $belongsTo ? $belongsTo : array(); |
| 1843 |
|
} |
| 1844 |
|
} |
| 1845 |
|
|
| 1846 |
|
/** |
| 1847 |
|
* Gets the class of a one-to-many relationship. If no $component is specified then an array of all the one-to-many |
|
@@ 1854-1862 (lines=9) @@
|
| 1851 |
|
* the field data stripped off. It defaults to TRUE. |
| 1852 |
|
* @return string|array|false |
| 1853 |
|
*/ |
| 1854 |
|
public function hasMany($classOnly = true) |
| 1855 |
|
{ |
| 1856 |
|
$hasMany = (array)$this->config()->get('has_many'); |
| 1857 |
|
if ($hasMany && $classOnly) { |
| 1858 |
|
return preg_replace('/(.+)?\..+/', '$1', $hasMany); |
| 1859 |
|
} else { |
| 1860 |
|
return $hasMany ? $hasMany : array(); |
| 1861 |
|
} |
| 1862 |
|
} |
| 1863 |
|
|
| 1864 |
|
/** |
| 1865 |
|
* Return the many-to-many extra fields specification. |