Schema::existsInDatabase

(사용 가능한 버전 정보가 없으며 Git에만 있을 수 있음)

Schema::existsInDatabase — 데이터베이스에 존재하는지 확인


설명

public mysql_xdevapi\Schema::existsInDatabase(): bool

현재 개체(스키마, 테이블, 컬렉션 또는 보기)가 스키마 개체에 존재하는지 확인합니다.

경고 이 함수는 현재 문서화되어 있지 않습니다. 해당 인수 목록만 사용할 수 있습니다.


매개변수

이 함수에는 매개변수가 없습니다.


반환 값

스키마, 테이블, 컬렉션 또는 뷰가 스키마에 여전히 존재하면 true이고, 그렇지 않으면 false입니다.


Examples

예제 #1 Schema::existsInDatabase 예제

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

$session->sql("DROP DATABASE IF EXISTS food")->execute();
$session->sql("CREATE DATABASE food")->execute();
$session->sql("CREATE TABLE food.fruit(name text, rating text)")->execute();

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

// ...

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

// ...

// Is this collection still in the database (schema)?
if ($trees->existsInDatabase()) {
    echo "Yes, the 'trees' collection is still present.";
}
                  
                

위의 예는 다음과 유사한 결과를 출력합니다.

Yes, the 'trees' collection is still present.