Thursday, February 10, 2011

Symfony Upgrade Issues

1. XXXPeer::doselectrs()
Fatal error: Call to undefined method XXXPeer::doselectrs() in /root/workspace/ProjectName/lib/model/XXXPeer.php on line 37
That method belongs to Propel 1.2, and you are using Propel 1.3, which was introduced into symfony in symfony version 1.2
http://www.propelorm.org/wiki/Documentation/1.3/Upgrading#NewPropelMethodSignatures

New Propel Method Signatures
Another change is related to PDO's lack of a ResultSet correlate. The generated Peer doSelectRS() method has been renamed doSelectStmt(). PDO does not have a ResultSet class, so the doSelectStmt() will return an executed statement.

Solved:
Change doSelectRS() to doSelectStmt()

2. PDOStatement::next()
Fatal error: Call to undefined method PDOStatement::next() /root/workspace/ProjectName/lib/model/XXXPeer.php on line 39
same link as above

Solved:
change

$rs = AuthorPeer::doSelectRS(new Criteria());
while($rs->next()) {
$a = new Author();
$a->hydrate($rs);
}


to

// example of how to manually hydrate objects
$stmt = AuthorPeer::doSelectStmt(new Criteria());
while($row = $stmt->fetch(PDO::FETCH_NUM)) {
$a = new Author();
$a->hydrate($row);
}


3. PDOStatement::getInt()
Fatal error: Call to undefined method PDOStatement::getInt() in /root/workspace/ProjectName/lib/model/XXXPeer.php on line 41

tried:
http://www.symfony-project.org/blog/2008/05/30/how-do-i-use-propel-1-3-in-symfony-1-1

$ cd /path/to/project/root/
$ svn co http://svn.symfony-project.com/plugins/sfPropelPlugin/branches/1.3/ plugins/sfPropelPlugin

no luck

4. stdClass::getName()
Fatal error: Call to undefined method stdClass::getName() in /root/workspace/PHPLIB_ResourceServiceAdapter/ResourceService/service/search/RES_ResourceConditionManager.php on line 54

5. Enable the Compatibility with the Version 1.0
/admerch/apps/cm/config/settings.yml

.settings:
compat_10: true

No comments:

Post a Comment