PHP 클래스 VersionPress\Database\DbSchemaInfo

파일 보기 프로젝트 열기: versionpress/versionpress 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string[] | Traversable $schemaFiles, string $prefix, integer $dbVersion )
getAllEntityNames ( ) : array Gets all entities defined by the schema
getAllMnReferences ( )
getAllReferences ( ) : array Returns a map where key is a name of an entity and value is a list of names of referenced entities.
getEntityInfo ( $entityName ) : EntityInfo Returns EntityInfo for a given entity name (e.g., "post" or "comment")
getEntityInfoByPrefixedTableName ( $tableName ) : EntityInfo Returns EntityInfo for a given table name with prefix (e.g., "wp_posts" or "wp_commentmeta")
getEntityInfoByTableName ( $tableName ) : EntityInfo Returns EntityInfo for a given table name (e.g., "posts" or "commentmeta")
getIntervalsForFrequentlyWrittenEntities ( )
getMnReferenceDetails ( $junctionEntity )
getPrefixedTableName ( $entityName ) : string For something like "post", returns "wp_posts"
getRulesForFrequentlyWrittenEntities ( ) : array Returns all rules for frequently written entities grouped by entity name.
getTableName ( $entityName ) : string For something like "post", returns "posts"
isChildEntity ( $entityName ) : boolean Returns true if entity has a parent reference.
isEntity ( $entityName ) : boolean Returns true if given name is an entity (is defined in schema).
refreshDbSchema ( $schemaFiles )
trimPrefix ( $tableName )

비공개 메소드들

메소드 설명
useSchemaForCurrentVersion ( $schema ) : array Returns valid schema for current version of WP.

메소드 상세

__construct() 공개 메소드

public __construct ( string[] | Traversable $schemaFiles, string $prefix, integer $dbVersion )
$schemaFiles string[] | Traversable
$prefix string
$dbVersion integer WordPress DB version (global variable $wp_db_version)

getAllEntityNames() 공개 메소드

Gets all entities defined by the schema
public getAllEntityNames ( ) : array
리턴 array

getAllMnReferences() 공개 메소드

public getAllMnReferences ( )

getAllReferences() 공개 메소드

Returns a map where key is a name of an entity and value is a list of names of referenced entities.
public getAllReferences ( ) : array
리턴 array

getEntityInfo() 공개 메소드

Returns EntityInfo for a given entity name (e.g., "post" or "comment")
public getEntityInfo ( $entityName ) : EntityInfo
$entityName
리턴 EntityInfo

getEntityInfoByPrefixedTableName() 공개 메소드

Returns EntityInfo for a given table name with prefix (e.g., "wp_posts" or "wp_commentmeta")
public getEntityInfoByPrefixedTableName ( $tableName ) : EntityInfo
$tableName
리턴 EntityInfo

getEntityInfoByTableName() 공개 메소드

Returns EntityInfo for a given table name (e.g., "posts" or "commentmeta")
public getEntityInfoByTableName ( $tableName ) : EntityInfo
$tableName
리턴 EntityInfo

getIntervalsForFrequentlyWrittenEntities() 공개 메소드

getMnReferenceDetails() 공개 메소드

public getMnReferenceDetails ( $junctionEntity )

getPrefixedTableName() 공개 메소드

For something like "post", returns "wp_posts"
public getPrefixedTableName ( $entityName ) : string
$entityName
리턴 string

getRulesForFrequentlyWrittenEntities() 공개 메소드

Returns all rules for frequently written entities grouped by entity name.

getTableName() 공개 메소드

For something like "post", returns "posts"
public getTableName ( $entityName ) : string
$entityName
리턴 string

isChildEntity() 공개 메소드

Returns true if entity has a parent reference.
public isChildEntity ( $entityName ) : boolean
$entityName
리턴 boolean

isEntity() 공개 메소드

Useful for prefixing VP tables.
public isEntity ( $entityName ) : boolean
$entityName
리턴 boolean

refreshDbSchema() 공개 메소드

public refreshDbSchema ( $schemaFiles )

trimPrefix() 공개 메소드

public trimPrefix ( $tableName )