array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'fr', ), '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' => 'en', '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 — Get all schema collections
Fetch a list of collections for this schema.
Cette fonction ne contient aucun paramètre.
Array of all collections in this schema, where each array element value is a Collection object with the collection name as the key.
Exemple #1 mysql_xdevapi\Schema::getCollections() example
<?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);
?>
Résultat de l'exemple ci-dessus est similaire à :
array(1) { ["people"]=> object(mysql_xdevapi\Collection)#4 (1) { ["name"]=> string(6) "people" } }