Find Data Tables
Find Data Tables by name.
Permissions Required
You must have Find permissions to a matching Data Table for it to be included in the results
Method Signature
find(Filter $filter = null, string $pageToken = null, int $pageSize = null): DataTablesPage
Parameters
Parameter | Type | Description |
---|---|---|
$filter | Filter | The filter criteria to search by, or null to fetch all Data Tables. |
$pageToken | string | The token of the page to fetch |
$pageSize | int | The number of DataTables to return per page |
returns | DataTablesPage | The requested page of Data Tables |
You can search for matches among the following attributes of the Where
class.
Name | Type | Description |
---|---|---|
text | string | Fuzzy matches the data table Name. |
Example
<?php
/*
* This example demonstrates finding all Data Tables and
* printing their names in a list
*/
require_once(__DIR__ . '/vendor/autoload.php');
use Catalytic\SDK\CatalyticClient;
use Catalytic\SDK\Search\Where;
$catalytic = new CatalyticClient();
$where = (new Where())->text()->matches('My example table');
$results = $catalytic->dataTables()->find($where);
$dataTables = $results->getDataTables();
// Loop through all the pages of results
while (!empty($results->getNextPageToken())) {
$results = $catalytic->dataTables()->find($where, $results->getNextPageToken());
$dataTables = array_merge($dataTables, $results->getDataTables());
}
foreach($tables as $table) {
echo $table->getName() . PHP_EOL;
}
Updated almost 3 years ago