Example #1
0
 public function db()
 {
     $entity_dir = $this->input('entitydir');
     if (!$entity_dir) {
         return $this->handleHelp('db');
     }
     $namespace = $this->input('namespace') ?? '';
     $entities = $this->getEntities($entity_dir, $namespace);
     Adapter::get()->beginTransaction();
     try {
         $this->synColumns($entities);
         $this->synForeignKeys($entities);
         Adapter::get()->commitTransaction();
     } catch (\Exception $ex) {
         Adapter::get()->rollback();
         throw $ex;
     }
 }
Example #2
0
 protected static function getAdapter()
 {
     return Adapter::get();
 }
Example #3
0
<?php

define('TEST_MVC', false);
require __DIR__ . '/boot.php';
use Leno\Database\Adapter;
var_dump(Adapter::get()->describeIndexes('user_book'));
Example #4
0
 public static function getAdapter()
 {
     return Adapter::get();
 }