Exemplo n.º 1
0
                $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(SearchIndexPeer::DATABASE_NAME, SearchIndexPeer::TABLE_NAME, $columns);
        if ($res !== true) {
            $request = sfContext::getInstance()->getRequest();
            foreach ($res as $failed) {
                $col = SearchIndexPeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME);
                $request->setError($col, $failed->getMessage());
            }
        }
        return $res;
    }
}
if (Propel::isInit()) {
    try {
        BaseSearchIndexPeer::getMapBuilder();
    } catch (Exception $e) {
        Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
    }
} else {
    require_once 'lib/model/map/SearchIndexMapBuilder.php';
    Propel::registerMapBuilder('lib.model.map.SearchIndexMapBuilder');
}