public static function doValidate(Establecimiento $obj, $cols = null) { $columns = array(); if ($cols) { $dbMap = Propel::getDatabaseMap(EstablecimientoPeer::DATABASE_NAME); $tableMap = $dbMap->getTable(EstablecimientoPeer::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(EstablecimientoPeer::DATABASE_NAME, EstablecimientoPeer::TABLE_NAME, $columns); if ($res !== true) { $request = sfContext::getInstance()->getRequest(); foreach ($res as $failed) { $col = EstablecimientoPeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME); } } return $res; }