public function postSave($object, $con) { $prefix = sfConfig::get(sprintf('propel_behavior_wikifiableBehavior_%s_prefix', get_class($object))); $default_description = sfConfig::get(sprintf('propel_behavior_wikifiableBehavior_%s_default_description', get_class($object)), 'Descrizione di default'); $default_user_comment = sfConfig::get(sprintf('propel_behavior_wikifiableBehavior_%s_default_user_comment', get_class($object)), 'Commento di default'); if ($this->was_new) { // add an automatic wiki description (and user comment) to a new wikifiable item nahoWikiToolkit::add_wiki_description($object, $prefix, $default_description, $default_user_comment); } }
} // get raw records, without populating objects, in order to be faster and lighter $acts_rs = call_user_func_array(array($model . 'Peer', 'doSelectRS'), array($c)); $cnt = 0; while ($acts_rs->next()) { // retrieve all primary key values, to fully retrieve the object $pk_values = array(); $i = 1; foreach ($pks as $pk) { $method = 'get' . ucfirst($pk->getType()); $pk_values[] = $acts_rs->{$method}($i++); } // fetch the object (needed to call the generateNews method) // then destroys it, in order to release memory $object = call_user_func_array(array($model . 'Peer', 'retrieveByPK'), $pk_values); try { nahoWikiToolkit::add_wiki_description($object, $name_prefix, sfConfig::get('nahoWikiPlugin_default_description'), "Creazione Automatica"); } catch (Exception $e) { echo "Exception: " . $e->getMessage() . "\n"; } unset($object); // increment partial and total counters $cnt++; $tot_cnt++; if ($cnt % 100 == 0) { echo $cnt . " "; } } echo "\n{$cnt} objects of type {$model} imported\n"; } echo "{$tot_cnt} total\n";