array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'mysql-xdevapi-schema.getcollections.php', 1 => 'Schema::getCollections', ), 'up' => array ( 0 => 'class.mysql-xdevapi-schema.php', 1 => 'mysql_xdevapi\\Schema', ), 'prev' => array ( 0 => 'mysql-xdevapi-schema.getcollectionastable.php', 1 => 'Schema::getCollectionAsTable', ), 'next' => array ( 0 => 'mysql-xdevapi-schema.getname.php', 1 => 'Schema::getName', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'ja', 'path' => 'reference/mysql_xdevapi/mysql_xdevapi/schema/getcollections.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(No version information available, might only be in Git)
Schema::getCollections — スキーマに属する全てのコレクションを取得する
この関数にはパラメータはありません。
このスキーマに属する全てのコレクションを配列にして返します。 個々の要素は、コレクション名をキーとし、コレクションオブジェクトが値となります。
例1 mysql_xdevapi\Schema::getCollections() の例
<?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");
$collect = $schema->createCollection("people");
$collect->add('{"name": "Fred", "age": 21, "job": "Construction"}')->execute();
$collect->add('{"name": "Wilma", "age": 23, "job": "Teacher"}')->execute();
$collections = $schema->getCollections();
var_dump($collections);
?>
上の例の出力は、 たとえば以下のようになります。
array(1) { ["people"]=> object(mysql_xdevapi\Collection)#4 (1) { ["name"]=> string(6) "people" } }