PHP 클래스 VersionPress\Utils\ReferenceUtils

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

공개 메소드들

메소드 설명
getMatchingPaths ( array | object $value, string $pathInStructure ) : array Returns list of all paths in hierarchic structure (nested arrays, objects) matching given pattern.
getMnReferenceDetails ( DbSchemaInfo $dbSchema, $entityName, $reference ) : array Returns complex info about the M:N reference. The source is always the given entity, target is the second one.
getValueReferenceDetails ( string $reference ) : array Returns parsed info about the value reference.
valueMatchesWildcard ( $valueWithWildcards, $value )

비공개 메소드들

메소드 설명
getMatchingPathsFromSubtree ( $value, $pathParts )
getSourceColumn ( DbSchemaInfo $dbSchema, $sourceEntity, $targetEntity, $junctionTable ) : string Returns name of column referencing synchronized entity in the junction table.

메소드 상세

getMatchingPaths() 공개 정적인 메소드

The pattern comes from a schema file. For example line some_option[/\d+/]["key"] contains pattern [/\d+/]["key"]. It can contain regular expressions to match multiple / dynamic keys. Examples: For $value = [0 => [key => value], 1 => [key => value]] And $pathInStructure = [0]["key"] Returns [[0, key]] For the same $value nad $pathInStructure = [/\d+/]["key"] Returns [[0, key], [1, key]]
public static getMatchingPaths ( array | object $value, string $pathInStructure ) : array
$value array | object
$pathInStructure string
리턴 array

getMnReferenceDetails() 공개 정적인 메소드

Returns complex info about the M:N reference. The source is always the given entity, target is the second one.
public static getMnReferenceDetails ( DbSchemaInfo $dbSchema, $entityName, $reference ) : array
$dbSchema VersionPress\Database\DbSchemaInfo
$entityName
$reference
리턴 array The details has keys 'junction-table', 'source-entity', 'source-column', 'target-entity' and 'target-column'.

getValueReferenceDetails() 공개 정적인 메소드

Returns parsed info about the value reference.
public static getValueReferenceDetails ( string $reference ) : array
$reference string
리턴 array The details has keys 'source-column', 'source-value', 'value-column'

valueMatchesWildcard() 공개 정적인 메소드

public static valueMatchesWildcard ( $valueWithWildcards, $value )