コード例 #1
0
 public function __construct()
 {
     $config = new \Doctrine\DBAL\Configuration();
     $connectionParams = array('dbname' => 'silex_blog', 'user' => 'root', 'password' => '', 'host' => 'localhost', 'driver' => 'pdo_mysql');
     $this->con = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config);
     $this->model = new ArticleModel($this->con);
     $user = new UserModel($this->con);
     $this->comment = new CommentModel($this->con);
     $user->deleteAllData();
     $user->sampleData();
 }
コード例 #2
0
 public function test()
 {
     $a = new Model\UserModel($this->app['db']);
     echo $a->deleteAllData();
 }