PHP Class Arcanedev\SeoHelper\Bases\MetaCollection

Author: ARCANEDEV ([email protected])
Inheritance: extends Arcanedev\Support\Collection, implements Arcanedev\SeoHelper\Contracts\Entities\MetaCollectionInterface
Show file Open project: arcanedev/seo-helper Class Usage Examples

Protected Properties

Property Type Description
$ignored array Ignored tags, they have dedicated class.
$items array The items contained in the collection.
$nameProperty string Meta tag name property.
$prefix string Meta tag prefix.

Public Methods

Method Description
__toString ( ) : string Render the tag.
add ( string $name, string $content ) : MetaCollection Add a meta to collection.
addMany ( array $metas ) : MetaCollection Add many meta tags.
forget ( string | array $keys ) : MetaCollection Remove an item from the collection by key.
remove ( array | string $names ) : MetaCollection Remove a meta from the collection by key.
render ( ) : string Render the tag.
setPrefix ( string $prefix ) : MetaCollection Set meta prefix name.

Protected Methods

Method Description
addMeta ( string $name, string $content ) : MetaCollection Make a meta and add it to collection.
isIgnored ( string $name ) : boolean Check if meta is ignored.
prepareName ( array | string $names ) : array Prepare names.

Private Methods

Method Description
refresh ( ) : MetaCollection Refresh meta collection items.

Method Details

__toString() public method

Render the tag.
public __toString ( ) : string
return string

add() public method

Add a meta to collection.
public add ( string $name, string $content ) : MetaCollection
$name string
$content string
return MetaCollection

addMany() public method

Add many meta tags.
public addMany ( array $metas ) : MetaCollection
$metas array
return MetaCollection

addMeta() protected method

Make a meta and add it to collection.
protected addMeta ( string $name, string $content ) : MetaCollection
$name string
$content string
return MetaCollection

forget() public method

Remove an item from the collection by key.
public forget ( string | array $keys ) : MetaCollection
$keys string | array
return MetaCollection

isIgnored() protected method

Check if meta is ignored.
protected isIgnored ( string $name ) : boolean
$name string
return boolean

prepareName() protected method

Prepare names.
protected prepareName ( array | string $names ) : array
$names array | string
return array

remove() public method

Remove a meta from the collection by key.
public remove ( array | string $names ) : MetaCollection
$names array | string
return MetaCollection

render() public method

Render the tag.
public render ( ) : string
return string

setPrefix() public method

Set meta prefix name.
public setPrefix ( string $prefix ) : MetaCollection
$prefix string
return MetaCollection

Property Details

$ignored protected property

Ignored tags, they have dedicated class.
protected array $ignored
return array

$items protected property

The items contained in the collection.
protected array $items
return array

$nameProperty protected property

Meta tag name property.
protected string $nameProperty
return string

$prefix protected property

Meta tag prefix.
protected string $prefix
return string