class TwitterCardImporter extends AbstractImporter

TwitterCardImporter class

Properties

protected FrontendHandler $frontend FrontendHandler instance from AbstractImporter
protected Request $request Request instance from AbstractImporter
protected array $metaItems meta items
protected array $cuts will be cut items name and length
protected array $needHost items of need prepend host
static protected UrlGenerator $urlGenerator UrlGenerator instance from AbstractImporter
protected string $username Twitter username

Methods

__construct(FrontendHandler $frontend, Request $request, string $username)

Constructor

void
exec(array $data)

Execute import job

string
extractUrl(array $data)

Extract url from data array

void
addMeta(string $key, string|array $contents)

Add meta tag

string
substr(string $origin, int $len)

Substr

string
prependHost(string $url)

prepend host to url path

static void
setUrlGenerator(UrlGenerator $urlGenerator)

Set url generator instance

static UrlGenerator
getUrlGenerator()

Get url generator instance

Details

at line 75
__construct(FrontendHandler $frontend, Request $request, string $username)

Constructor

Parameters

FrontendHandler $frontend FrontendHandler instance
Request $request Request instance
string $username twitter username

at line 88
void exec(array $data)

Execute import job

Parameters

array $data data array

Return Value

void

in AbstractImporter at line 119
protected string extractUrl(array $data)

Extract url from data array

Parameters

array $data data array

Return Value

string

in AbstractImporter at line 140
protected void addMeta(string $key, string|array $contents)

Add meta tag

Parameters

string $key item key
string|array $contents meta content

Return Value

void

in AbstractImporter at line 162
protected string substr(string $origin, int $len)

Substr

Parameters

string $origin origin text
int $len cut length

Return Value

string

in AbstractImporter at line 175
protected string prependHost(string $url)

prepend host to url path

Parameters

string $url url path

Return Value

string

in AbstractImporter at line 186
static void setUrlGenerator(UrlGenerator $urlGenerator)

Set url generator instance

Parameters

UrlGenerator $urlGenerator UrlGenerator instance

Return Value

void

in AbstractImporter at line 196
static UrlGenerator getUrlGenerator()

Get url generator instance

Return Value

UrlGenerator