Eccube\Tests\EccubeTestCase::deleteAllRows PHP Method

deleteAllRows() public method

このメソッドは、参照制約の関係で、 Doctrine ORM ではデータ削除できない場合に使用する. 通常は、 EntityManager::remove() を使用して削除すること.
public deleteAllRows ( array $tables )
$tables array 削除対象のテーブル名の配列
    public function deleteAllRows(array $tables)
    {
        $pdo = $this->app['orm.em']->getConnection()->getWrappedConnection();
        foreach ($tables as $table) {
            $sql = 'DELETE FROM ' . $table;
            $stmt = $pdo->prepare($sql);
            $stmt->execute();
        }
    }