We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 953
    • 4 Posts
    alexanderfranca Reply #1, 14 years ago
    Hi.

    I couldn’t find the way to build my fisical tables from the schema file.

    []s
    Alexander
    Brazil
      • 953
      • 4 Posts
      alexanderfranca Reply #2, 14 years ago
      Ok, I’ve found it.

      First I have to create the models.

      And after create the tables from the models (the code below assumes that the model is already created, it’s just to create the table):

      $dsn = 'mysql:host=localhost;dbname=learning';
      $xpdo = new xPDO($dsn, $username='root', $password='password');
      
      $xpdo->setDebug(true);
      $xpdo->setLogLevel(xPDO::LOG_LEVEL_INFO);  
      $xpdo->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML');  
      
      $xpdo->addPackage('learning', '/var/www/localhost/htdocs/learning/model/','ln_');
      
      $lear = $xpdo->newObject('LearningTable');
      
      $manager = $xpdo->getManager();
      
      $manager->createObjectContainer('LearningTable');



      []s
      Alexander
      Brazil