PHP 클래스 Node

S -> P P -> T R I I -> P I -> e R -> '[]' N O R -> N O O -> '{' P '}' O -> e N -> 'token=name' T -> 'token=type'
파일 보기 프로젝트 열기: croogo/croogo 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$actsAs array Behaviors used by the Model
$belongsTo array Model associations: belongsTo
$filterArgs array Filter search fields
$findMethods
$guid string Guid
$name string Model name
$type string If the Model is associated to Node model, this variable holds the Node type value
$validate array Validation

공개 메소드들

메소드 설명
beforeFind ( $queryData ) : array beforeFind callback
beforeSave ( $options = [] ) : boolean beforeSave callback
filterNodes ( $data = [] ) : array Return filter condition for Nodes
filterPublishedNodes ( $data = [] ) : array Return filter condition for Nodes
formatData ( array $data, string $typeAlias = self::DEFAULT_TYPE ) : array Format data for saving
isUniquePerType ( array $fields, boolean $or = true ) : boolean Returns false if any fields passed match any (by default, all if $or = false) of their matching values.
saveNode ( $data, $typeAlias = self::DEFAULT_TYPE ) : mixed Create/update a Node record
updateAllNodesPaths ( ) : boolean | array Update values for all nodes 'path' field

보호된 메소드들

메소드 설명
_findPromoted ( $state, $query, $results = [] ) Find promoted nodes
_findPublished ( $state, $query, $results = [] ) Search published nodes
_findViewById ( $state, $query, $results = [] ) Find a single node by id
_findViewBySlug ( $state, $query, $results = [] ) Find a single node by slug
_getNodeRelativePath ( array $node ) : string getNodeRelativePath
_getType ( array $data ) : string _getType
_mergeQueryFilters ( &$query, $key, $values ) : void mergeQueryFilters

메소드 상세

_findPromoted() 보호된 메소드

Find promoted nodes
또한 보기: Model::find()
또한 보기: Model::_findAll()
protected _findPromoted ( $state, $query, $results = [] )

_findPublished() 보호된 메소드

$query options: - q: term to search - roleId: Role Id - typeAlias: Type alias
protected _findPublished ( $state, $query, $results = [] )

_findViewById() 보호된 메소드

Find a single node by id
protected _findViewById ( $state, $query, $results = [] )

_findViewBySlug() 보호된 메소드

Find a single node by slug
protected _findViewBySlug ( $state, $query, $results = [] )

_getNodeRelativePath() 보호된 메소드

getNodeRelativePath
protected _getNodeRelativePath ( array $node ) : string
$node array Node array
리턴 string relative node path

_getType() 보호된 메소드

_getType
protected _getType ( array $data ) : string
$data array Node data
리턴 string type

_mergeQueryFilters() 보호된 메소드

mergeQueryFilters
또한 보기: Node::_findPromoted()
protected _mergeQueryFilters ( &$query, $key, $values ) : void
리턴 void

beforeFind() 공개 메소드

beforeFind callback
public beforeFind ( $queryData ) : array
리턴 array

beforeSave() 공개 메소드

beforeSave callback
public beforeSave ( $options = [] ) : boolean
리턴 boolean

filterNodes() 공개 메소드

Return filter condition for Nodes
public filterNodes ( $data = [] ) : array
리턴 array Array of conditions

filterPublishedNodes() 공개 메소드

Return filter condition for Nodes
public filterPublishedNodes ( $data = [] ) : array
리턴 array Array of conditions

formatData() 공개 메소드

Format data for saving
public formatData ( array $data, string $typeAlias = self::DEFAULT_TYPE ) : array
$data array Node and related data, eg Taxonomy and Role
$typeAlias string string Node type alias
리턴 array formatted data

isUniquePerType() 공개 메소드

Returns false if any fields passed match any (by default, all if $or = false) of their matching values.
public isUniquePerType ( array $fields, boolean $or = true ) : boolean
$fields array Field/value pairs to search (if no values specified, they are pulled from $this->data)
$or boolean If false, all fields specified must match in order for a false return value
리턴 boolean False if any records matching any fields are found

saveNode() 공개 메소드

Create/update a Node record
public saveNode ( $data, $typeAlias = self::DEFAULT_TYPE ) : mixed
$data array Node data
$typeAlias string Node type alias
리턴 mixed see Model::saveAll()

updateAllNodesPaths() 공개 메소드

Update values for all nodes 'path' field
또한 보기: Model::saveMany()
public updateAllNodesPaths ( ) : boolean | array
리턴 boolean | array Depending on atomicity

프로퍼티 상세

$actsAs 공개적으로 프로퍼티

Behaviors used by the Model
public array $actsAs
리턴 array

$belongsTo 공개적으로 프로퍼티

Model associations: belongsTo
public array $belongsTo
리턴 array

$filterArgs 공개적으로 프로퍼티

Filter search fields
public array $filterArgs
리턴 array

$findMethods 공개적으로 프로퍼티

public $findMethods

$guid 공개적으로 프로퍼티

Guid
public string $guid
리턴 string

$name 공개적으로 프로퍼티

Model name
public string $name
리턴 string

$type 공개적으로 프로퍼티

If the Model is associated to Node model, this variable holds the Node type value
public string $type
리턴 string

$validate 공개적으로 프로퍼티

Validation
public array $validate
리턴 array