« Schema::getName
Schema::getTable »

Schema::getSession

(No version information available, might only be in Git)

Schema::getSession — スキーマのセッションを取得する

説明

public function mysql_xdevapi\Schema::getSession(): mysql_xdevapi\Session

スキーマオブジェクトから、新しいセッションオブジェクトを取得します。

パラメータ

この関数にはパラメータはありません。

戻り値

Session オブジェクトを返します。

例

例1 mysql_xdevapi\Schema::getSession() の例

<?php
$session = mysql_xdevapi\getSession("mysqlx://user:password@localhost");
$session->sql("DROP DATABASE IF EXISTS addressbook")->execute();
$session->sql("CREATE DATABASE addressbook")->execute();

$schema  = $session->getSchema("addressbook");

// ...

$newsession = $schema->getSession();

var_dump($session);
var_dump($newsession);
?>

上の例の出力は、 たとえば以下のようになります。

object(mysql_xdevapi\Session)#1 (0) {
}

object(mysql_xdevapi\Session)#3 (0) {
}
関連キーワード:
Schema   mysql   xdevapi   getSession   session   スキーマ   セッション   Session   addressbook   execute   schema   newsession   dump   getName   getTable   information   available   mysqlx   user   password   localhost   getSchema
関連する関数・ページ:
mysql-xdevapi-schema.getname   mysql-xdevapi-session.getschema   mysql-xdevapi-schema.gettable   mysql-xdevapi-schema.construct   class.mysql-xdevapi-schema   mysql-xdevapi-collection.getsession