@param \TakaakiMizuno\MWBParser\Elements\Table      $table
@param \TakaakiMizuno\MWBParser\Elements\Table[]    $tables
@param \LaravelRocket\Generator\Objects\Definitions $json

@return bool
491152
public function insert($table, $tables, $json): bool
    {
        $this->json = $json;

        $this->setTargetTable($table, $tables);

        if (!$this->needGenerate()) {
            return false;
        }

        $filePath = $this->getTargetFilePath();

        $json = $this->parseJson($filePath);

        $exist = $this->checkItAlreadyExists($json);
        if ($exist) {
            return false;
        }

        $json = $this->insertItem($json);

        return $this->outputJson($json, $filePath);
    }
584834
public function hasTable($table)
	{
            $sql = $this->grammar->compileTableExists($table);
            $statement = $this->connection->getBatchQuery($sql, []);
            $data = $statement->getResultSet();
            return $data->result()? true: false;
          
	}
248119
public function ensureContentTypeGroupsExists(TableNode $table)
    {
        $contentTypeGroups = $table->getTable();

        array_shift($contentTypeGroups);
        foreach ($contentTypeGroups as $contentTypeGroup) {
            $this->ensureContentTypeGroupExists($contentTypeGroup[0]);
        }
    }
521552
public function parse($path, $tables, $json)
    {
        $this->path     = $path;
        $parser         = new SwaggerParser();
        $this->document = $parser->parseFile($path);

        $this->tables = $tables;
        $this->json   = $json;

        $documentObject = new OpenAPISpec($this->document, $this->tables, $this->json);

        return $documentObject;
    }
858544
public static function isJSON($json)
    {
        if ($json === '[]' || $json === '{}') {
            return true;
        } else if (is_array($json)) {
            return false;
        }

        return static::decode($json) != null;
    }
309313
private function _prepareJoinTable(array $tables)
	{
		$this->tables = ' ';
		foreach($tables as $tableObj)
		{
			$this->tables .= $tableObj->getExpression() . ', ';
		}
		$this->tables = rtrim(rtrim($this->tables), ',') . ' ';
	}
1284509
public function table_exists( Table $table ) {

		$statement = new GenericStatement( "SHOW TABLES LIKE %s" );
		$result = $this->database
			->query_statement( $statement, [ (string) $table ] );

		if ( ! $result->valid() )
			return FALSE;

		/**
		 * @todo refactor this as soon as
		 * we have unified options bit-mask implemented
		 * to get results in single-level arrays
		 *
		 * return $result->contains( $table );
		 */

		$tables = [];
		foreach ( $result as $row ) {
			$tables = array_merge(
				$tables,
				array_values(
					get_object_vars( $row )
				)
			);
		}
		return in_array( $table, $tables );
	}
1032656
public function saveTable($table, array &$data)
    {
        $file = $this->path . '/' . $table . '.json';
        $data = $this->touchModified($data);

        $opt  = is_numeric($this->opt['json_options'])
            ? $this->opt['json_options']
            : 0;

        $dept = is_numeric($this->opt['json_depth'])
            ? $this->opt['json_depth']
            : 512;

        return file_put_contents($file, json_encode($data, $opt, $dept), LOCK_EX) > 0;
    }
572406
public function table($table, ...$tables)
    {
        array_unshift($tables, $table);

        foreach ($tables as $table) {
            list($tableAlias, $tableName) = $this->dialect()->parseTable($table);

            if (!is_scalar($tableName)) {
                throw new SqlException('Derived tables are not supported in UPDATE statement.');
            }

            $tableKey = $tableAlias ?: $tableName;

            $tableName = $this->dialect()->quoteTable($tableName);

            if ($tableAlias) {
                $tableAlias = $this->dialect()->quoteName($tableAlias);
            }

            $this->tables[$tableKey] = [
                'tableKey' => $tableKey,
                'table'    => $tableName,
                'alias'    => $tableAlias,
            ];
        }

        return $this;
    }
423335
public function delete(string $table, string $id): bool
    {
        return $this->deleteWhere($table, 'id', $id);
    }
935211
protected function checkItAlreadyExists($json): bool
    {
        $pathName = $this->tableObject->getPathName();
        foreach (Arr::get($json, 'items', []) as $item) {
            if (Arr::get($item, 'url', '') == '/'.$pathName) {
                return true;
            }
        }

        return false;
    }
1090862
public function updateTable($table, ...$tables)
    {
        $instance = $this->updateQueryInstance();

        $instance->updateQuery()->table($table, ...$tables);

        return $instance;
    }
685250
public function from($table, ...$tables)
    {
        $instance = $this->fromStrategyInstance();

        $instance->fromStrategy()->from($table, ...$tables);

        return $instance;
    }
153447
public function seeInDatabase($table, array $data)
    {
        return $this->assertInDatabase($table, $data, sprintf(
            "Didn't see row in the '%s' table that matched the attributes '%s'.",
            $table, json_encode($data)
        ));
    }
1029767
public function thereAreSuchUnits(TableNode $table)
    {
        foreach ($table as $row) {
            $this->iCreateUnitWithShortcut($row['name'], $row['shortcut']);
        }
    }
552447
public function filter($table)
    {
        $this->enableRecursive(true);

        foreach ($table->getRows() as $row) {
            $row->deleteMetadata($this->metadataToRemove);

            $this->filterSubTable($row);
        }
    }
1094898
public function initialize(Table $table)
    {
        $this->table = $table;
        $this->table->setTableId($this->tableId);
    }