Documentation Home
MySQL PHP API
Download this Manual
PDF (US Ltr) - 2.5Mb
PDF (A4) - 2.4Mb
HTML Download (TGZ) - 250.9Kb
HTML Download (Zip) - 258.4Kb


MySQL PHP API  /  ...  /  Collection::getName

5.7.9 Collection::getName

Copyright 1997-2019 the PHP Documentation Group.

  • Collection::getName

    Get collection name

Description

public string mysql_xdevapi\Collection::getName();

Retrieve the collection's name.

Parameters

This function has no parameters.

Return Values

The collection name, as a string.

Examples

Example 5.19 mysql_xdevapi\Collection::getName 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");
$collection = $schema->createCollection("people");


// ...

var_dump($collection->getName());
?>

The above example will output something similar to:

string(6) "people"