PHP Class Bolt\Storage\Collection\Taxonomy

Author: Ross Riley ([email protected])
Inheritance: extends Doctrine\Common\Collections\ArrayCollection
Mostrar archivo Open project: bolt/bolt

Public Properties

Property Type Description
$config

Public Methods

Method Description
__construct ( array $elements = [], MetadataDriver $metadata = null ) Taxonomy constructor.
containsKeyValue ( $field, $value )
filter ( Closure $p )
getExisting ( ) : Taxonomy Gets the elements that have already been persisted
getField ( $fieldname ) : Taxonomy Gets a specific taxonomy name from the overall collection
getNew ( ) * Gets the elements that have not yet been persisted
getOriginal ( $entity ) : mixed | null This loops over the existing collection to see if the properties in the incoming are already available on a saved record. To do this it checks the three key properties content_id, taxonomytype and slug, if there's a match it returns the original, otherwise it returns the new and adds the new one to the collection.
getSortorder ( $field, $slug )
offsetGet ( $offset ) Required by interface ArrayAccess.
setFromDatabaseValues ( $result )
setFromPost ( $formValues, $entity )
update ( Taxonomy $collection ) : array Runs a check on an incoming collection to make sure that duplicates are filtered out. Precedence is given to records that are already persisted, with any diff in incoming properties updated.

Method Details

__construct() public method

Taxonomy constructor.
public __construct ( array $elements = [], MetadataDriver $metadata = null )
$elements array
$metadata Bolt\Storage\Mapping\MetadataDriver

containsKeyValue() public method

public containsKeyValue ( $field, $value )

filter() public method

public filter ( Closure $p )
$p Closure

getExisting() public method

Gets the elements that have already been persisted
public getExisting ( ) : Taxonomy
return Taxonomy

getField() public method

Gets a specific taxonomy name from the overall collection
public getField ( $fieldname ) : Taxonomy
$fieldname
return Taxonomy

getNew() public method

* Gets the elements that have not yet been persisted
public getNew ( )

getOriginal() public method

This loops over the existing collection to see if the properties in the incoming are already available on a saved record. To do this it checks the three key properties content_id, taxonomytype and slug, if there's a match it returns the original, otherwise it returns the new and adds the new one to the collection.
public getOriginal ( $entity ) : mixed | null
$entity
return mixed | null

getSortorder() public method

public getSortorder ( $field, $slug )

offsetGet() public method

public offsetGet ( $offset )

setFromDatabaseValues() public method

public setFromDatabaseValues ( $result )

setFromPost() public method

public setFromPost ( $formValues, $entity )

update() public method

Any records not in the incoming set are deleted from the collection and the deleted ones returned as an array.
public update ( Taxonomy $collection ) : array
$collection Taxonomy
return array

Property Details

$config public_oe property

public $config