We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42324
    • 2 Posts
    Hello ! I created a component but I have a problem. I have a scheme that creates three tables. My _build seems correct, but when I install my component, there is only one table that is created...

      • 42324
      • 2 Posts
      Solved :

      <?php
      if ($object->xpdo) {
          switch ($options[xPDOTransport::PACKAGE_ACTION]) {
              case xPDOTransport::ACTION_INSTALL:
                  $modx =& $object->xpdo;
                  $modelPath = $modx->getOption('mycomponent.core_path',null,$modx->getOption('core_path').'components/mycomponent/').'model/';
                  $modx->addPackage('mycomponent',$modelPath);
      $manager = $modx->getManager();
      /* My first table object */
      $manager->createObjectContainer('mycomponentObject');
      /* My second table object */
      $manager->createObjectContainer('mycomponentConfig');
      /* My third table object */
      $manager->createObjectContainer('mycomponentOutput');
      break;
              case xPDOTransport::ACTION_UPGRADE:
                  break;
          }
      }
      return true;