Development

#3909 (Sample hydrate() method to automatically set the culture returns nothing)

You must first sign up to be able to contribute.

Ticket #3909 (closed documentation: fixed)

Opened 2 months ago

Last modified 2 months ago

Sample hydrate() method to automatically set the culture returns nothing

Reported by: dstaver Assigned to: fabien
Priority: minor Milestone:
Component: model Version: 1.0.17
Keywords: Cc:
Qualification: Unreviewed

Description

The sample code from 13-9 in the book to automatically set the culture doesn't return the number of hydrated columns:

http://www.symfony-project.org/book/1_0/13-I18n-and-L10n#Using%20the%20Generated%20I18n%20Objects

The hydrate() method should return the number of hydrated columns (the result of parent::hydrate($rs, $startcol)), but the code from the book returns nothing.

This code works:

    public function hydrate(ResultSet $rs, $startcol = 1)
    {
        $this->setCulture(sfContext::getInstance()->getUser()->getCulture());
        return parent::hydrate($rs, $startcol);
    }

I had unexpected bugs with the sfPropelFinder plugin when using the incorrect hydrate() method.

Change History

07/07/08 18:53:41 changed by fabien

  • status changed from new to closed.
  • resolution set to fixed.

(In [10172]) doc: fixed typo (closes #3909)