PHP 클래스 Term

상속: extends BaseModel
파일 보기 프로젝트 열기: croogo/croogo 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$actsAs array Behaviors used by the Model
$findMethods
$hasAndBelongsToMany array Model associations: hasAndBelongsToMany
$name string Model name
$validate array Validation

공개 메소드들

메소드 설명
add ( $data, $vocabularyId ) : array | boolean Save term
beforeDelete ( $cascade = true ) : boolean Allow delete on whether given Term has any association left with Taxonomy
edit ( $data, $vocabularyId ) : array | boolean Edit term
hasSlugChanged ( integer $id, string $slug ) : boolean Checks wether slug has changed for given Term id
isInVocabulary ( integer $id, integer $vocabularyId, integer $taxonomyId = null ) : boolean Convenience method to check whether term exists within a vocabulary
remove ( integer $id, integer $vocabularyId ) Remove term
saveAndGetId ( array $data ) : integer Save Term and return ID.
setScopeForTaxonomy ( integer $vocabularyId ) Set Scope
slugExists ( $slug ) : boolean Convenience check for slug

보호된 메소드들

메소드 설명
_findByVocabulary ( $state, $query, $results = [] )
_save ( array $data, integer $vocabularyId, integer $taxonomyId = null ) Save new/updated term data

메소드 상세

_findByVocabulary() 보호된 메소드

protected _findByVocabulary ( $state, $query, $results = [] )

_save() 보호된 메소드

Save new/updated term data
protected _save ( array $data, integer $vocabularyId, integer $taxonomyId = null )
$data array Term data
$vocabularyId integer Vocabulary Id
$taxonomyId integer Taxonomy Id

add() 공개 메소드

Save term
또한 보기: Term::_save()
public add ( $data, $vocabularyId ) : array | boolean
리턴 array | boolean Array of saved term or boolean false

beforeDelete() 공개 메소드

Allow delete on whether given Term has any association left with Taxonomy
public beforeDelete ( $cascade = true ) : boolean
리턴 boolean

edit() 공개 메소드

Edit term
또한 보기: Term::_save()
public edit ( $data, $vocabularyId ) : array | boolean
리턴 array | boolean Array of saved term or boolean false

hasSlugChanged() 공개 메소드

Checks wether slug has changed for given Term id
public hasSlugChanged ( integer $id, string $slug ) : boolean
$id integer Term Id
$slug string Slug
리턴 boolean True if slug has changed

isInVocabulary() 공개 메소드

Convenience method to check whether term exists within a vocabulary
public isInVocabulary ( integer $id, integer $vocabularyId, integer $taxonomyId = null ) : boolean
$id integer Term Id
$vocabularyId integer Vocabulary Id
$taxonomyId integer Taxonomy Id
리턴 boolean True if Term exists in Vocabulary

remove() 공개 메소드

Remove term
public remove ( integer $id, integer $vocabularyId )
$id integer Term Id
$vocabularyId integer Vocabulary Id

saveAndGetId() 공개 메소드

Save Term and return ID.
public saveAndGetId ( array $data ) : integer
$data array
리턴 integer

setScopeForTaxonomy() 공개 메소드

Set Scope
public setScopeForTaxonomy ( integer $vocabularyId )
$vocabularyId integer Vocabulary Id

slugExists() 공개 메소드

Convenience check for slug
public slugExists ( $slug ) : boolean
리턴 boolean

프로퍼티 상세

$actsAs 공개적으로 프로퍼티

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

$findMethods 공개적으로 프로퍼티

public $findMethods

$hasAndBelongsToMany 공개적으로 프로퍼티

Model associations: hasAndBelongsToMany
public array $hasAndBelongsToMany
리턴 array

$name 공개적으로 프로퍼티

Model name
public string $name
리턴 string

$validate 공개적으로 프로퍼티

Validation
public array $validate
리턴 array