Schema::getCollection

Get collection from schema

&reftitle.description; public `mysql_xdevapi\Collection` `mysql_xdevapi\Schema::getCollection` `string` `name`

Get a collection from the schema.

&reftitle.parameters;

`name`

- Collection name to retrieve.

&reftitle.returnvalues;

The Collection object for the selected collection.

&reftitle.examples;

### Schema::getCollection example

    <?php
    $session = mysql_xdevapi\getSession("mysqlx://user:password@localhost");

    $session->sql("DROP DATABASE IF EXISTS food")->execute();
    $session->sql("CREATE DATABASE food")->execute();

    $schema = $session->getSchema("food");
    $schema->createCollection("trees");

    // ...

    $trees = $schema->getCollection("trees");

    var_dump($trees);

&example.outputs.similar;

    object(mysql_xdevapi\Collection)#3 (1) {
      ["name"]=>
      string(5) "trees"
    }