public static function doValidate(Escalanota $obj, $cols = null) { $columns = array(); if ($cols) { $dbMap = Propel::getDatabaseMap(EscalanotaPeer::DATABASE_NAME); $tableMap = $dbMap->getTable(EscalanotaPeer::TABLE_NAME); if (!is_array($cols)) { $cols = array($cols); } foreach ($cols as $colName) { if ($tableMap->containsColumn($colName)) { $get = 'get' . $tableMap->getColumn($colName)->getPhpName(); $columns[$colName] = $obj->{$get}(); } } } else { } $res = BasePeer::doValidate(EscalanotaPeer::DATABASE_NAME, EscalanotaPeer::TABLE_NAME, $columns); if ($res !== true) { $request = sfContext::getInstance()->getRequest(); foreach ($res as $failed) { $col = EscalanotaPeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME); } } return $res; }