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:
nate 2008-05-22 12:56:41 +00:00
parent be63f26e78
commit 5def68bf30
3 changed files with 33 additions and 8 deletions

View file

@ -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'];
}