PHP 클래스 Webiny\Component\Entity\EntityDataExtractor

상속: use trait Webiny\Component\StdLib\StdLibTrait
파일 보기 프로젝트 열기: webiny/framework 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$cache
$currentLevel
$entity AbstractEntity
$nestedLevel

공개 메소드들

메소드 설명
__construct ( AbstractEntity $entity ) Maximum depth is 10 which is hard to achieve
extractData ( array $attributes = [] ) : array Extract AbstractEntity data to array using specified list of attributes.

비공개 메소드들

메소드 설명
buildEntityFields ( string | array $fields ) : array Parse fields string and build nested fields structure.
If array is given, will just return that array.
buildFields ( ArrayObject &$parsedFields, StringObject $key ) Parse attribute key recursively
buildNestedKeys ( $fields )
getDefaultAttributes ( ) : string Get default list of entity attributes.
Only simple and Many2One attributes are considered to be default attributes.
getSubAttributesFromArray ( $subAttributes, $array )
parseGroupedNestedFields ( StringObject $string ) : StringObject Check if there are grouped nested keys (by using '[' and ']' and converts that string into a plain version - a string that only contains comma-separated full paths of each field

메소드 상세

__construct() 공개 메소드

Maximum depth is 10 which is hard to achieve
public __construct ( AbstractEntity $entity )
$entity AbstractEntity

extractData() 공개 메소드

If no attributes are specified, only simple and Many2One attributes will be extracted. If you need to get One2Many and Many2Many attributes, you need to explicitly specify a list of attributes.
public extractData ( array $attributes = [] ) : array
$attributes array Ex: 'title,author.name,comments.id,comments.text'
리턴 array

프로퍼티 상세

$cache 보호되어 있는 정적으로 프로퍼티

protected static $cache

$currentLevel 보호되어 있는 정적으로 프로퍼티

protected static $currentLevel

$entity 보호되어 있는 프로퍼티

protected AbstractEntity,Webiny\Component\Entity $entity
리턴 AbstractEntity

$nestedLevel 보호되어 있는 프로퍼티

protected $nestedLevel