PHP Класс Devise\Pages\Interpreter\TagManager

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$CollectionsRepository Devise\Pages\Collections\CollectionsRepository Collections Repository to fiddle with collections
$DvsCollectionSet DvsCollectionSet Dvs Collection Set model
$DvsField DvsField Dvs Field model
$DvsGlobalField DvsGlobalField Dvs Global Field model
$DvsModelField DvsModelField Dvs Model Field model
$languageId integer Language id
$pageId integer Page id
$pageVersionId integer Page version id

Открытые методы

Метод Описание
__construct ( DvsField $DvsField, DvsGlobalField $DvsGlobalField, DvsCollectionSet $DvsCollectionSet, DvsModelField $DvsModelField, CollectionsRepository $CollectionsRepository ) Create a new tag manager
getInstanceForTag ( array $tag ) : DvsField | DvsCollection | DvsModelField | DvsGlobalField Find this tag in the database
initialize ( integer $pageId, integer $pageVersionId, integer $languageId ) : void Initializes values for our tag manager

Защищенные методы

Метод Описание
assertInitialized ( ) : void Assert that pageId, pageVersionId and languageId are all set
createCollectionSet ( array $tag ) : DvsCollectionSet Create a collection set from this tag
createFieldInstance ( array $tag ) : DvsField Create a new field instance
createMissingModelFields ( array $tag, $fields, $mappings ) : void Ensures that all model fields are created for a model's picks
createModelField ( integer $modelId, string $modelType, string $mapping ) : DvsModelField Creates this model field for us in the database this will also restore an existing soft deleted model field if it finds one.
fetchMappingsForModelField ( array $tag ) : array Finds the mappings for this model type This allows us to know if we have created enough DvsModelField entries in the database
fetchModelFields ( integer $modelId, string $modelType, array $mappings, $onlyTrashed = false ) : Collection Fetch all the model fields
filterModelFieldByAttribute ( $modelFields, string $attribute ) : DvsModelField Filters out the attribute from this model field
findField ( array $tag ) : DvsField Find the field in the database
findGlobalField ( array $tag ) : DvsGlobalField Finds a global field for this tag
getInstanceForAttribute ( array $tag ) : DvsModelField Get the instance for a model attribute in this tag
getInstanceForCollection ( array $tag ) : DvsCollectionSet Get the instance of a collection. This is the CollectionSet with all instances attached
getInstanceForCreator ( array $tag ) : StdClass There is no database instance for creators.
getInstanceForField ( $tag ) : DvsField | DvsGlobalField Find this field in database
getInstanceForModel ( array $tag ) : DvsModelField Get the instance for a model in this tag
getInstanceForVariable ( array $tag ) : array Get the instance for a variable type. We cannot do much with this since we haven't identified what type of variable this is, e.g. model or attribute.
restoreFieldInstance ( array $tag ) : DvsField If there is a field instance that has been deleted, then we restore it cuz we need it again
updateInstance ( Eloquent $instance, array $fields ) : void Updates an instance with the fields given but only if the field values are different than what is already in the database

Описание методов

__construct() публичный метод

Create a new tag manager
public __construct ( DvsField $DvsField, DvsGlobalField $DvsGlobalField, DvsCollectionSet $DvsCollectionSet, DvsModelField $DvsModelField, CollectionsRepository $CollectionsRepository )
$DvsField DvsField
$DvsGlobalField DvsGlobalField
$DvsCollectionSet DvsCollectionSet
$DvsModelField DvsModelField
$CollectionsRepository Devise\Pages\Collections\CollectionsRepository

assertInitialized() защищенный метод

Assert that pageId, pageVersionId and languageId are all set
protected assertInitialized ( ) : void
Результат void

createCollectionSet() защищенный метод

Create a collection set from this tag
protected createCollectionSet ( array $tag ) : DvsCollectionSet
$tag array
Результат DvsCollectionSet

createFieldInstance() защищенный метод

Create a new field instance
protected createFieldInstance ( array $tag ) : DvsField
$tag array
Результат DvsField

createMissingModelFields() защищенный метод

Ensures that all model fields are created for a model's picks
protected createMissingModelFields ( array $tag, $fields, $mappings ) : void
$tag array
Результат void

createModelField() защищенный метод

..
protected createModelField ( integer $modelId, string $modelType, string $mapping ) : DvsModelField
$modelId integer
$modelType string
$mapping string
Результат DvsModelField

fetchMappingsForModelField() защищенный метод

Finds the mappings for this model type This allows us to know if we have created enough DvsModelField entries in the database
protected fetchMappingsForModelField ( array $tag ) : array
$tag array
Результат array

fetchModelFields() защищенный метод

Fetch all the model fields
protected fetchModelFields ( integer $modelId, string $modelType, array $mappings, $onlyTrashed = false ) : Collection
$modelId integer
$modelType string
$mappings array
Результат Collection

filterModelFieldByAttribute() защищенный метод

Filters out the attribute from this model field
protected filterModelFieldByAttribute ( $modelFields, string $attribute ) : DvsModelField
$attribute string
Результат DvsModelField

findField() защищенный метод

Find the field in the database
protected findField ( array $tag ) : DvsField
$tag array
Результат DvsField

findGlobalField() защищенный метод

Finds a global field for this tag
protected findGlobalField ( array $tag ) : DvsGlobalField
$tag array
Результат DvsGlobalField

getInstanceForAttribute() защищенный метод

Get the instance for a model attribute in this tag
protected getInstanceForAttribute ( array $tag ) : DvsModelField
$tag array
Результат DvsModelField

getInstanceForCollection() защищенный метод

Get the instance of a collection. This is the CollectionSet with all instances attached
protected getInstanceForCollection ( array $tag ) : DvsCollectionSet
$tag array
Результат DvsCollectionSet

getInstanceForCreator() защищенный метод

.. this doesn't really make sense, but it is here for the sake of consistency, since all the other tag types have database stuff
protected getInstanceForCreator ( array $tag ) : StdClass
$tag array
Результат StdClass

getInstanceForField() защищенный метод

Find this field in database
protected getInstanceForField ( $tag ) : DvsField | DvsGlobalField
$tag
Результат DvsField | DvsGlobalField | DvsGlobalField

getInstanceForModel() защищенный метод

Get the instance for a model in this tag
protected getInstanceForModel ( array $tag ) : DvsModelField
$tag array
Результат DvsModelField

getInstanceForTag() публичный метод

Find this tag in the database
public getInstanceForTag ( array $tag ) : DvsField | DvsCollection | DvsModelField | DvsGlobalField
$tag array
Результат DvsField | DvsCollection | DvsModelField | DvsGlobalField | DvsCollection | DvsModelField | DvsGlobalField

getInstanceForVariable() защищенный метод

Get the instance for a variable type. We cannot do much with this since we haven't identified what type of variable this is, e.g. model or attribute.
protected getInstanceForVariable ( array $tag ) : array
$tag array
Результат array

initialize() публичный метод

Initializes values for our tag manager
public initialize ( integer $pageId, integer $pageVersionId, integer $languageId ) : void
$pageId integer
$pageVersionId integer
$languageId integer
Результат void

restoreFieldInstance() защищенный метод

If there is a field instance that has been deleted, then we restore it cuz we need it again
protected restoreFieldInstance ( array $tag ) : DvsField
$tag array
Результат DvsField

updateInstance() защищенный метод

Updates an instance with the fields given but only if the field values are different than what is already in the database
protected updateInstance ( Eloquent $instance, array $fields ) : void
$instance Eloquent
$fields array
Результат void

Описание свойств

$CollectionsRepository защищенное свойство

Collections Repository to fiddle with collections
protected CollectionsRepository,Devise\Pages\Collections $CollectionsRepository
Результат Devise\Pages\Collections\CollectionsRepository

$DvsCollectionSet защищенное свойство

Dvs Collection Set model
protected DvsCollectionSet $DvsCollectionSet
Результат DvsCollectionSet

$DvsField защищенное свойство

Dvs Field model
protected DvsField $DvsField
Результат DvsField

$DvsGlobalField защищенное свойство

Dvs Global Field model
protected DvsGlobalField $DvsGlobalField
Результат DvsGlobalField

$DvsModelField защищенное свойство

Dvs Model Field model
protected DvsModelField $DvsModelField
Результат DvsModelField

$languageId защищенное свойство

Language id
protected int $languageId
Результат integer

$pageId защищенное свойство

Page id
protected int $pageId
Результат integer

$pageVersionId защищенное свойство

Page version id
protected int $pageVersionId
Результат integer