PHP 7.4.8 Released!


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

Schema::getCollectionsGet all schema collections


public mysql_xdevapi\Schema::getCollections ( void ) : array

Fetch a list of collections for this schema.

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

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

$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();

L'exemple ci-dessus va afficher quelque chose de similaire à :

array(1) {
  object(mysql_xdevapi\Collection)#4 (1) {
    string(6) "people"
add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top