The sfPropelPager class has been refactored since I last updated the
wiki.
init() will try to query for the class path and fail because you're
now returning the helper object.
A workaround would be copy sfPropelPager::init() to your derived
class,
and modify the lines from "require the model class" as below:
[code]
// require the model class (because autoloading can crash under
some conditions)
if (is_string($this->getClassPeer()))
{
if (!$classPath = sfCore::getClassPath($this->getClassPeer()))
{
throw new sfException(sprintf('Unable to find path for class
"%s".', $this->getClassPeer()));
}
require_once($classPath);
}
$count = call_user_func(array($this->getClassPeer(), $this-
>getPeerCountMethod()), $cForCount);
...................
[/code]
On Jul 9, 6:04 am, cyrille <[EMAIL PROTECTED]> wrote:
> same issues for me, does anyone have an answer ? adventex, have you
> find a solution ?
>
> regards,
> cyrille.
>
> On 23 mai, 15:33, adventex <[EMAIL PROTECTED]> wrote:
>
>
>
> > I'm having a lot of trouble getting the custome join helper class to
> > work with pager. There is a section dedicated to this topic at the
> > bottom of this
> > page:http://trac.symfony-project.com/trac/wiki/ApplyingCustomJoinsUsingHelper
> > however, following those directions precisely still yields the
> > following error:
>
> > Unable to find path for class "Contact".
> > stack trace
>
> > * at ()
> > in SF_SYMFONY_LIB_DIR/addon/propel/sfPropelPager.class.php line
> > 55 ...
> > 52. // require the model class (because autoloading
> > can crash under some conditions)
> > 53. if (!$classPath =
> > sfCore::getClassPath($this->getClassPeer()))
>
> > 54. {
> > 55. throw new sfException(sprintf('Unable to find
> > path for class "%s".', $this->getClassPeer()));
> > 56. }
> > 57. require_once($classPath);
> > 58. $count = call_user_func(array($this-
>
> > >getClassPeer(), $this->getPeerCountMethod()), $cForCount);
>
> > This is the code that generates that error:
> > $joinHelper = newsfPropelCustomJoinHelper('Contact');
> > $joinHelper->addSelectTables('ContactAddress','ContactPhone');
> > $joinHelper->setHas('Contact','ContactPhone');
> > $joinHelper->setHas('Contact','ContactAddress');
>
> > $pager = new myPropelPager('Contact', 10);
> > $pager->setCriteria($c);
> > $pager->setPage($this->getRequestParameter('page', 1));
> > $pager->setClassPeer($joinHelper);
>
> > If I remove the last line: '$pager->setClassPeer($joinHelper);' I
> > don't get an error which tells me that the Contact class exists. It
> > seems that custom class created by the helper cannot be found by the
> > pager, any thoughts?- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---