protected function addReload(&$script) { $parentReload = ''; parent::addReload($parentReload); // disable default criteria during the call to doSelectStmt $doSelectStmt = "\$stmt = " . $this->getPeerClassname() . "::doSelectStmt(\$this->buildPkeyCriteria(), \$con);"; $doSelectPos = strpos($parentReload, $doSelectStmt); if ($doSelectPos === false) { throw new EngineException("Unexpected: could not find the call to doSelectStmt in reload function"); } $newLine = "\n\t\t"; $script .= substr($parentReload, 0, $doSelectPos) . $this->getPeerClassname() . "::setUseCriteriaFilter(false);" . $newLine . "\$criteria = \$this->buildPkeyCriteria();" . $newLine . $this->getPeerClassname() . "::addSelectColumns(\$criteria);" . $newLine . "\$stmt = BasePeer::doSelect(\$criteria, \$con);" . $newLine . $this->getPeerClassname() . "::setUseCriteriaFilter(true);" . substr($parentReload, $doSelectPos + strlen($doSelectStmt)); }