mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-08 12:32:42 +00:00
Updating Model test to reflect TreeBehavior changes, adding association support to Model::getColumnType()
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7005 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
be63f26e78
commit
5def68bf30
3 changed files with 33 additions and 8 deletions
|
@ -873,6 +873,14 @@ class Model extends Overloadable {
|
|||
*/
|
||||
function getColumnType($column) {
|
||||
$cols = $this->schema();
|
||||
$model = null;
|
||||
|
||||
if (strpos($column, '.')) {
|
||||
list($model, $column) = explode('.', $column);
|
||||
}
|
||||
if ($model != $this->alias && isset($this->{$model})) {
|
||||
return $this->{$model}->getColumnType($column);
|
||||
}
|
||||
if (isset($cols[$column]) && isset($cols[$column]['type'])) {
|
||||
return $cols[$column]['type'];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue