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; } }
protected static function getAdapter() { return Adapter::get(); }
<?php define('TEST_MVC', false); require __DIR__ . '/boot.php'; use Leno\Database\Adapter; var_dump(Adapter::get()->describeIndexes('user_book'));
public static function getAdapter() { return Adapter::get(); }