\FAA\Obj\GenericArticle

Summary

Methods
Properties
Constants
__construct()
Images()
MainImage()
SearchFields()
GeneralSearchFields()
Interval()
TrailInterval()
GetTrailPriceFormatted()
GetPriceFormated()
StockCount()
IsBundle()
BundleArticles()
ToPlainObject()
AssignImage()
ToLocalDataJson()
$amount
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$amount

$amount :integer

Type

integer—The amount

Methods

__construct()

__construct(string|null  $id = null,string|null  $language = null,string  $type = 'article')

Article constructor.

Parameters

string|null $id

The article id or null

string|null $language

The object language or null

string $type

The child type when needed

Images()

Images(boolean  $resolved = false): array

List images

Get the content of the images attribute relation Will generate and return an empty array hen attribute is not filled

Parameters

boolean $resolved

Returns

array

SearchFields()

SearchFields(): array

Get search fields

Returns

array —

The search fields

GeneralSearchFields()

GeneralSearchFields(): array

The general search fields

Returns

array

Interval()

Interval(): null|string

Get interval

If the article has an interval, read it from sub content and return it as string. Will return null when nothing is set.

Returns

null|string

TrailInterval()

TrailInterval(): null|string

Get tail interval

If the article has an interval, read it from sub content and return it as string. Will return null when nothing is set.

Returns

null|string

GetTrailPriceFormatted()

GetTrailPriceFormatted(integer  $count = 1,boolean  $tax = false,string  $dec = ',',string  $tho = '.'): string

Get formatted trail price of instance

Parameters

integer $count

The multiplier

boolean $tax

Include taxes?

string $dec

The decimal seperator

string $tho

The thousands seperator

Returns

string —

The formatted price

GetPriceFormated()

GetPriceFormated(integer  $count = 1,boolean  $tax = false,string  $dec = ',',string  $tho = '.'): string

Get formatted price of instance

Parameters

integer $count

The multiplier

boolean $tax

Include taxes?

string $dec

The decimal seperator

string $tho

The thousands seperator

Returns

string —

The formatted price

StockCount()

StockCount(): integer

Get physical available count in stock

Will calculate automatically the amount of assemblable items

Returns

integer —

The sum of assembled and splitted available items

IsBundle()

IsBundle(): boolean

Is a bundle

When this article is composed of bundle articles return true

Returns

boolean —

The status

BundleArticles()

BundleArticles(boolean  $resolve = false,boolean  $plain_language = false): array

Get bundle articles

Fetch the bundle articles as raw list or, resolved

Parameters

boolean $resolve

When true, resolve sub content

boolean $plain_language

When given, translate it

Returns

array —

The list of children when it is a bundle

ToPlainObject()

ToPlainObject(string  $language = null,boolean  $with_parent = true,boolean  $recurse = true): \stdClass

Convert to plain data set

Translate and expose the current data attribute as plain resolved object

Parameters

string $language

A system language code or empty for raw setup

boolean $with_parent

When set to true the attributes will be resolved witch parent attributes included

boolean $recurse

When true, resolve child contents as well

Returns

\stdClass —

A simple attribute based php object

AssignImage()

AssignImage(\FAA\Obj\Generic\Asset  $asset): \FAA\Obj\Result

Assign an image

Parameters

\FAA\Obj\Generic\Asset $asset

An asset instance

Returns

\FAA\Obj\Result —

The result object

ToLocalDataJson()

ToLocalDataJson(\FAA\Obj\Request  $request,array  $org = null): string

Convert to json

Generate a json ld entry of the given element

Parameters

\FAA\Obj\Request $request

A system request

array $org

Additional information about the organisation

Returns

string —

The json-ld content