Hello,

Hope you don't mind if I contact your directly. Considering the propel tree. I'm writting a recursive algorithm and I wish to write something like:


$root = new TreeNode();
$root->makeRoot();

$aNode = recusriveFct();

$aNode->insertAsLastChildOf($root);
$root->save();

function recusriveFct(){
   $answer = null;
   if (test){
      $answer = new TreeNode();
   }else if (test2){
      $nodeR = recursive();
      $nodeR->insertAsFirstChildof($answer);
   }
return $answer; }

I was hoping that the save() function would cascade all TreeNode and save it correctly, but instead it only add the first node/root couple and then nothing. Looking at the code it seems that the AST PHP class is based on SQL entierly and never on php object in memory. This means that I have to do save() anytime I change a structure (using insertAs function essentially) This lead to more DB usage and lesss flexibility in the tree usage. Is it right or is it me missusing this plugin ? Is there another way to do this ?

As a solution, I'm about to create a temporary in memory tree object representation and after recusrively create it with AST plugin insertAs functions but this is heavier do you have another idea ?

Thanks.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to