setColumn('authorId', 'integer', 4, array('notnull')); $class->setColumn('date', 'integer', 4, array('notnull')); $class->hasOne('QueryTest_User as author', array('local' => 'authorId', 'foreign' => 'id')); } }