title: How to change the format of an attribute in a CActiveRecord returned by a findAll method?
body: <p>I have an attribute in my model that is stored in binary format inside database.
  In case the attribute is a geometric( polygon ) object.</p>
  
  <p>This object can be casted to several string representations.
  So how can I attach an event after a find execution that allows me to change the attribute on returned set only?</p>
  
  <p>My first guess was to use the onAfterFind event but it is not calling the handler with the created element as documentation suggests. My first attempt was the following in the controller.</p>
  
  <pre><code>// an activeRecord class
  GeoTableBinaryData extends CActiveRecord {
   ... // normal active record with a table which has a binary attribute called geom
  }
  
  $model = GeoTableBinaryData::model();
  $model-&gt;onAfterFind-&gt;add(
    function( CEvent $evt ){
      // get the finded object to update the geom attribute on the fly here want
      // a text representation in other case would transform it to XML or JSON
    }
  );
  
  foreach ( $model-&gt;findAll() as $geoInfo )
  {
    ... // output serialized geometry
  }
  </code></pre>