Example #1
0
 public function __construct($table)
 {
     $tables = Metadata::getInstance()->get('tables');
     if (empty($tables[$table])) {
         throw new \Yabcms\Exception(sprintf('table "%s" not defined in metadata', $table));
     }
     $this->table = $tables[$table];
     $this->pdo = Database::getInstance()->getConnection($this->table['connection']);
     $this->driver = $this->pdo->getAttribute(\PDO::ATTR_DRIVER_NAME);
 }
Example #2
0
<?php

require_once 'bootstrap.php';
$user = new Yabcms\Module\User();
var_dump($user, \Yabcms\Metadata::getInstance()->get('tables'));
Example #3
0
<?php

set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__);
require 'vendor/autoload.php';
$config = \Yabcms\Config::getInstance();
$config->setConfig(__DIR__ . DIRECTORY_SEPARATOR . 'config.php');
$metadata = \Yabcms\Metadata::getInstance();
Example #4
0
 public function __construct()
 {
     $this->metadata = \Yabcms\Metadata::getInstance();
 }