Plenty

Plugin

Application

The main application

Namespace

Plenty\Plugin

Methods

public register(string $providerClassName):void

Register a service provider with the application.

Parameters
string $providerClassName the classname with namespace of the provider
public bind(string $abstract, string $concrete = null, bool $shared = false):void

Register a binding with the container.

Parameters
string $abstract
string $concrete
bool $shared
public singleton(string $abstract, string $concrete = null):void

Register a shared binding in the container.

Parameters
string $abstract
string $concrete
public make(string $abstract, array $parameters = []):void
Parameters
string $abstract
array $parameters
public makeWith(string $abstract, array $parameters = []):void
Parameters
string $abstract
array $parameters
public abort(int $code, string $message = "", array $headers = []):void

Throw an HttpException with the given data.

Parameters
int $code
string $message
array $headers
public getWebstoreId():int

Returns current webstoreId

public getPlentyId():int
public isAdminPreview():bool
public isBackendRequest():bool
public getUrlPath(string $pluginName = ""):string

Returns the URL to the plugin resources

Parameters
string $pluginName

CachingRepository

caching repository

Namespace

Plenty\Plugin

Methods

public has(string $key):bool

Determine if an item exists in the cache.

Parameters
string $key
public get(string $key, $default = null):void

Retrieve an item from the cache by key.

Parameters
string $key
$default
public many(array $keys):array

Retrieve multiple items from the cache by key.

Parameters
array $keys
public pull(string $key, $default = null):void

Retrieve an item from the cache and delete it.

Parameters
string $key
$default
public put(string $key, $value, int $minutes = null):void

Store an item in the cache.

Parameters
string $key
$value
int $minutes
public putMany(array $values, int $minutes):void

Store multiple items in the cache for a given number of minutes.

Parameters
array $values
int $minutes
public add(string $key, $value, int $minutes):bool

Store an item in the cache if the key does not exist.

Parameters
string $key
$value
int $minutes
public remember(string $key, int $minutes, callable $callback):void

Get an item from the cache, or store the default value.

Parameters
string $key
int $minutes
callable $callback
public forget(string $key):bool

Remove an item from the cache.

Parameters
string $key
public static getPrefix():string

Controller

Controller

Namespace

Plenty\Plugin

RouteServiceProvider

Route service provider

Namespace

Plenty\Plugin

Methods

public getApplication():Application
public getEventDispatcher():Dispatcher

SessionRepository

session repository

Namespace

Plenty\Plugin

Methods

public has(string $key):bool

Determine if the given session value exists.

Parameters
string $key
public get(string $key, $default = null):void

Get the specified session value.

Parameters
string $key
$default
public set(string $key, $value = null):void

Set a given session value.

Parameters
string $key
$value
public prepend(string $key, $value):void

Prepend a value onto an array session value.

Parameters
string $key
$value
public push(string $key, $value):void

Push a value onto an array session value.

Parameters
string $key
$value
public static getPrefix():string

DataExchangeServiceProvider

Data Exchange service provider

Namespace

Plenty\Plugin

Methods

public getApplication():Application
public getEventDispatcher():Dispatcher

ConfigRepository

configuration repository

Namespace

Plenty\Plugin

Methods

public has(string $key):bool

Determine if the given configuration value exists.

Parameters
string $key
public get(string $key, $default = null):mixed

Get the specified configuration value.

Parameters
string $key
$default
public set(string $key, $value = null):void

Set a given configuration value.

Parameters
string $key
$value
public prepend(string $key, $value):void

Prepend a value onto an array configuration value.

Parameters
string $key
$value
public push(string $key, $value):void

Push a value onto an array configuration value.

Parameters
string $key
$value
public static getPrefix():string

ServiceProvider

Service provider for plugins

Namespace

Plenty\Plugin

Methods

public addGlobalMiddleware(string $middleware):void

Add a new middleware to end of the stack if it does not already exist.

Parameters
string $middleware
public getApplication():Application
public getEventDispatcher():Dispatcher

Middleware

Middleware

Namespace

Plenty\Plugin

Methods

public before(Request
 $request):void
Parameters
Request $request
public after(Request
 $request, Response
 $response):Response
Parameters
Request $request
Response $response

Validation

Validator

Base Validator Class

Namespace

Plenty\Validation

Properties

Type Name Description
customMessageKey

Methods

public static validateOrFail(array $data):void
Parameters
array $data
public buildCustomMessages():void
public getAttributeValue(string $attribute):void

Get the value of the given attribute.

Parameters
string $attribute
public defineAttributes():void
public add(string $attributeName):Attribute
Parameters
string $attributeName
public addConditional(string $attributeName, bool $required):Attribute
Parameters
string $attributeName
bool $required
public addInt(string $attributeName, bool $required = false):Attribute
Parameters
string $attributeName
bool $required
public addNumeric(string $attributeName, bool $required = false):Attribute
Parameters
string $attributeName
bool $required
public addDate(string $attributeName, bool $required = false):Attribute
Parameters
string $attributeName
bool $required
public addBool(string $attributeName, bool $required = false):Attribute
Parameters
string $attributeName
bool $required
public addString(string $attributeName, bool $required = false):Attribute
Parameters
string $attributeName
bool $required
public sometimes(string $attributeName, callable $condition):Attribute

Add a rule for an attribute based on the result of the condition callback.

Parameters
string $attributeName
callable $condition

DummyAttribute

Dummy Attribute Class

Namespace

Plenty\Validation

Methods

public getAttributeName():string
public setAttributeName(string $attributeName):Validation
Parameters
string $attributeName
public accepted():Validation

The field under validation must be yes, on, 1, or true. This is useful for validating "Terms of Service" acceptance.

public activeUrl():Validation

The field under validation must be a valid URL according to the checkdnsrr PHP function.

public dateAfter(string $fieldNameOrTimeStr):Validation

The field under validation must be a value after a given date. The dates will be passed into the strtotime PHP function.

Parameters
string $fieldNameOrTimeStr
public alphabetic():Validation

The field under validation must be entirely alphabetic characters.

public alphaDash():Validation

The field under validation may have alpha-numeric characters, as well as dashes and underscores.

public alphaNum():Validation

The field under validation must be entirely alpha-numeric characters.

public isArray():Validation

The field under validation must be a PHP array.

public dateBefore(string $fieldNameOrTimeStr):Validation

The field under validation must be a value preceding the given date. The dates will be passed into the PHP strtotime function.

Parameters
string $fieldNameOrTimeStr
public between(int $min, int $max):Validation

The field under validation must have a size between the given min and max. Strings, numerics, and files are evaluated in the same fashion as the size rule.

Parameters
int $min
int $max
public boolean():Validation

The field under validation must be able to be cast as a boolean. Accepted input are true, false, 1, 0, "1", and "0".

public confirmed():Validation

The field under validation must have a matching field of foo_confirmation. For example, if the field under validation is password, a matching password_confirmation field must be present in the input.

public date():Validation

The field under validation must be a valid date according to the strtotime PHP function.

public present():Validation

Validate that an attribute exists even if not filled.

public dateFormat(string $format):Validation

The field under validation must match the given format. The format will be evaluated using the PHP date_parse_from_format function.

Parameters
string $format
public different(string $fieldName):Validation

The field under validation must have a different value than field.

Parameters
string $fieldName
public digits(int $count):Validation

The field under validation must be numeric and must have an exact length of $count.

Parameters
int $count
public digitsBetween(int $min, int $max):Validation

The field under validation must have a length between the given min and max.

Parameters
int $min
int $max
public email():Validation

The field under validation must be formatted as an e-mail address.

public exists(string $table, array $columns = []):Validation

The field under validation must exist on a given database table.

Parameters
string $table
array $columns
public image():Validation

The file under validation must be an image (jpeg, png, bmp, gif, or svg)

public in(array $values):Validation

The field under validation must be included in the given list of values.

Parameters
array $values
public integer():Validation

The field under validation must be an integer.

public ip():Validation

The field under validation must be an IP address.

public json():Validation

The field under validation must a valid JSON string.

public max(int $value):Validation

The field under validation must be less than or equal to a maximum value. Strings, numerics, and files are evaluated in the same fashion as the size rule.

Parameters
int $value
public mimeTypes(array $types):Validation

The file under validation must have a MIME type corresponding to one of the listed extensions.

Parameters
array $types
public min(int $value):Validation

The field under validation must have a minimum value. Strings, numerics, and files are evaluated in the same fashion as the size rule.

Parameters
int $value
public notIn($values):Validation

The field under validation must not be included in the given list of values.

Parameters
$values
public numeric():Validation

The field under validation must be numeric.

public regex(string $pattern):Validation

The field under validation must match the given regular expression.

Parameters
string $pattern
public required():Validation

The field under validation must be present in the input data and not empty. A field is considered "empty" is one of the following conditions are true: The value is null.

public requiredIf(string $fieldName, $value):Validation

The field under validation must be present if the anotherfield field is equal to any value.

Parameters
string $fieldName
$value
public requiredUnless(string $fieldName, string $value):Validation

The field under validation must be present unless the anotherfield field is equal to any value.

Parameters
string $fieldName
string $value
public requiredWith(array $fieldNames):Validation

The field under validation must be present only if any of the other specified fields are present.

Parameters
array $fieldNames
public requiredWithAll(array $fieldNames):Validation

required_with_all

Parameters
array $fieldNames
public requiredWithout(array $fieldNames):Validation

The field under validation must be present only when any of the other specified fields are not present.

Parameters
array $fieldNames
public requiredWithoutAll(array $fieldNames):Validation

The field under validation must be present only when all of the other specified fields are not present.

Parameters
array $fieldNames
public notLike(string $fieldName):Validation

The field under validation must be not like the specified name.

Parameters
string $fieldName
public same(string $fieldName):Validation

The given field must match the field under validation.

Parameters
string $fieldName
public size(int $value):Validation

The field under validation must have a size matching the given value. For string data, value corresponds to the number of characters.

Parameters
int $value
public string():Validation

The field under validation must be a string.

public timezone():Validation

The field under validation must be a valid timezone identifier according to the timezone_identifiers_list PHP function.

public unique(string $table, string $column, string $except = null, string $idColumn = null):Validation

The field under validation must be unique on a given database table. If the column option is not specified, the field name will be used.

Parameters
string $table
string $column
string $except
string $idColumn
public url():Validation

The field under validation must be a valid URL according to PHP's filter_var function.

public sometimes():Validation

In some situations, you may wish to run validation checks against a field only if that field is present in the input array. To quickly accomplish this, add the sometimes rule.

public nullable():Validation

The field under validation may be null. This is particularly useful when validating primitive such as strings and integers that can contain null values.

public generateRulesContent():void
public dateW3C(bool $allowTimestamps = false):Validation

The field under validation must be a valid w3c formated date time string.

Parameters
bool $allowTimestamps Allow timestamps as a valid format as well.
public customRule(string $rule, array $params):Validation

Add custom Role

Parameters
string $rule
array $params
public validPlentyId():Validation

The field under validation must be a valid plentyId.

public typeFromDb(string $table, string $column, string $attribute, string $comparisonKey = "id"):Validation

The field under validation must have the type specified in the database.

Parameters
string $table The table with the data type
string $column The column with the data type
string $attribute The attribute in the validator with the key
string $comparisonKey The column to in $table to compare $attribute to. Default is 'id'.
public hexColor():void
public rgbColor():void
public cssColor():void
public color():void
public uuid5():void
public validDbType():Validation

The field under validation must be a valid data type used by the validation rule 'typeFromDb'.

public validCurrency():Validation

The field under validation must be a valid currency string (e.g. 'EUR').

public validBoardTaskReferenceValue():Validation

The field under validation must be a valid board task reference type (e.g. {@link BoardTaskReferenceType::CONTACT}).

RulesCollection

RulesCollection

Namespace

Plenty\Validation

Methods

public add(string $attributeName):Attribute
Parameters
string $attributeName
public addConditional(string $attributeName, bool $required):Attribute
Parameters
string $attributeName
bool $required
public addInt(string $attributeName, bool $required = false):Attribute
Parameters
string $attributeName
bool $required
public addNumeric(string $attributeName, bool $required = false):Attribute
Parameters
string $attributeName
bool $required
public addDate(string $attributeName, bool $required = false):Attribute
Parameters
string $attributeName
bool $required
public addBool(string $attributeName, bool $required = false):Attribute
Parameters
string $attributeName
bool $required
public addString(string $attributeName, bool $required = false):Attribute
Parameters
string $attributeName
bool $required
public sometimes(string $attributeName, callable $condition):Attribute

Add a rule for an attribute based on the result of the condition callback.

Parameters
string $attributeName
callable $condition

Exceptions

ValidationException

Namespace

Plenty\Exceptions

Properties

Type Name Description
messageBag

Methods

public getMessageBag():MessageBag
public setMessageBag(MessageBag
 $messageBag):Exceptions
Parameters
MessageBag $messageBag

ExternalAuth

Contracts

ExternalAccessRepositoryContract

Find and create ExternalAccess-datasets

Namespace

Plenty\Plugin\ExternalAuth\Contracts

Methods

public create(array $data):ExternalAccess

Create a new ExternalAccess record

Parameters
array $data The data for the ExternalAccess record to be created with. Must be an associative array with the keys 'contactId', 'accessType', 'externalContactId' and optionally an external 'accessToken'.
public findForTypeAndExternalId(string $type, string $externalId):ExternalAccess

Find

Parameters
string $type The type of the external access
string $externalId The external ID of the contact
public findForTypeAndContactId(string $type, int $contactId):ExternalAccess
Parameters
string $type The type of the external access
int $contactId The (internal) ID of the contact

Models

ExternalAccess

Information on a contact's external access tokens

Namespace

Plenty\Plugin\ExternalAuth\Models

Properties

Type Name Description
int contactId The ID of the contact in question. Must be unique in combination with $accessType.
string accessType The type/provider of external access. Must be unique in combination with $contactId.
string externalContactId The ID of the contact at the external provider.
string accessToken The token for the external access.
Carbon lastUpdate The Date when this record was updated the last time.

Methods

public toArray()

Returns this model as an array.

Services

ExternalAuthService

Log in users with external auth

Namespace

Plenty\Plugin\ExternalAuth\Services

Methods

public logInWithExternalUserId(string $externalId, string $type):void
Parameters
string $externalId
string $type

Plugin

Translation

Translator

translation service

Namespace

Plenty\Plugin\Translation

Methods

public trans(string $id, array $parameters = [], string $locale = null):void

Get the translation for a given key.

Parameters
string $id
array $parameters
string $locale

Http

Response

Class to create different types of http response.

Namespace

Plenty\Plugin\Http

Methods

public status():int

Get the status code for the response.

public content():string

Get the content of the response.

public make(string $content = "", int $status = 200, array $headers = []):Response

Return a new response from the application.

Parameters
string $content
int $status
array $headers
public view(string $view, array $data = [], int $status = 200, array $headers = []):Response

Return a new view response from the application.

Parameters
string $view
array $data
int $status
array $headers
public json($data = [], int $status = 200, array $headers = [], int $options):Response

Return a new JSON response from the application.

Parameters
$data
int $status
array $headers
int $options
public jsonp(string $callback, $data = [], int $status = 200, array $headers = [], int $options):Response

Return a new JSONP response from the application.

Parameters
string $callback
$data
int $status
array $headers
int $options
public stream(callable $callback, int $status = 200, array $headers = []):Response

Return a new streamed response from the application.

Parameters
callable $callback
int $status
array $headers
public redirectTo(string $path, int $status = 302, array $headers = [], bool $secure = null):Response

Create a new redirect response to the given path.

Parameters
string $path
int $status
array $headers
bool $secure
public redirectToRoute(string $route, array $parameters = [], int $status = 302, array $headers = []):Response

Create a new redirect response to a named route.

Parameters
string $route
array $parameters
int $status
array $headers
public redirectToAction(string $action, array $parameters = [], int $status = 302, array $headers = []):Response

Create a new redirect response to a controller action.

Parameters
string $action
array $parameters
int $status
array $headers
public redirectGuest(string $path, int $status = 302, array $headers = [], bool $secure = null):Response

Create a new redirect response, while putting the current URL in the session.

Parameters
string $path
int $status
array $headers
bool $secure
public redirectToIntended(string $default = "/", int $status = 302, array $headers = [], bool $secure = null):Response

Create a new redirect response to the previously intended location.

Parameters
string $default
int $status
array $headers
bool $secure
public sendHeaders():Http

Send the HTTP headers without sending the whole response.

public forceStatus(int $status = 200):Http

Force sending response with defined status instead of falling back to default handlers in case of 40* status codes.

Parameters
int $status
public isStatusForced():bool

Check if response should be send instead of falling back to default handlers in case of 40* status codes.

Request

http request

Namespace

Plenty\Plugin\Http

Methods

public all():array

Get all of the input and files for the request.

public merge(array $input):void

Merge new input into the current request's input array.

Parameters
array $input
public replace(array $input):void

Replace the input for the current request.

Parameters
array $input
public get(string $key, $default = null, bool $deep = false):void
Parameters
string $key
$default
bool $deep
public getContent():string

Returns the request body content.

public getRequestUri():string

Returns the requested URI (path and query string).

public exists($key):bool

Determine if the request contains a given input item key.

Parameters
$key
public has($key):bool

Determine if the request contains a non-empty value for an input item.

Parameters
$key
public input(string $key = null, $default = null):void

Retrieve an input item from the request.

Parameters
string $key
$default
public only($keys):array

Get a subset of the items from the input data.

Parameters
$keys
public except($keys):array

Get all of the input except for a specified array of items.

Parameters
$keys
public query(string $key = null, $default = null):void

Retrieve a query string item from the request.

Parameters
string $key
$default
public hasHeader(string $key):bool

Determine if a header is set on the request.

Parameters
string $key
public header(string $key = null, $default = null):void

Retrieve a header from the request.

Parameters
string $key
$default
public isJson():bool

Determine if the request is sending JSON.

public wantsJson():bool

Determine if the current request is asking for JSON in return.

public accepts($contentTypes):bool

Determines whether the current requests accepts a given content type.

Parameters
$contentTypes
public prefers($contentTypes):string

Return the most suitable content type from the given array based on content negotiation.

Parameters
$contentTypes
public acceptsJson():bool

Determines whether a request accepts JSON.

public acceptsHtml():bool

Determines whether a request accepts HTML.

public format(string $default = "html"):string

Get the data format expected in the response.

Parameters
string $default
public getUserInfo():string

Gets the user info.

public getHttpHost():string

Returns the HTTP host being requested.

public getSchemeAndHttpHost():string

Gets the scheme and HTTP host.

public getUri():string

Generates a normalized URI (URL) for the Request.

public getUriForPath(string $path):string

Generates a normalized URI for the given path.

Parameters
string $path A path to use instead of the current one
public getQueryString():string

Generates the normalized query string for the Request.

public getMethod():string

Gets the request "intended" method.

Templates

Markdown

A simple markdown converter.

Namespace

Plenty\Plugin\Templates

Methods

public renderToHtml(string $markdownContent):string
Parameters
string $markdownContent

View

view support

Namespace

Plenty\Plugin\Templates

Methods

public render(string $templatePath, array $data = []):string
Parameters
string $templatePath
array $data
public exists(string $templatePath):bool
Parameters
string $templatePath

Twig

Twig engine

Namespace

Plenty\Plugin\Templates

Methods

public render(string $name, array $context = []):string

Renders a template.

Parameters
string $name The template name
array $context An array of parameters to pass to the template
public renderString(string $templateContent, array $context = []):string

Renders a template from a string.

Parameters
string $templateContent The template to render
array $context An array of parameters to pass to the template
public addExtension(string $extension):void

Registers an extension.

Parameters
string $extension A Twig_ExtensionInterface instance

Log

LoggerFactory

Logger factory

Namespace

Plenty\Plugin\Log

Methods

public getLogger(string $pluginNamespace, string $identifier):LoggerContract
Parameters
string $pluginNamespace
string $identifier

Routing

Route

Route

Namespace

Plenty\Plugin\Routing

Methods

public addMiddleware(array $middleware):Routing

Add middlewares attached to the route.

Parameters
array $middleware
public middleware(array $middleware = []):Routing

Get or set the middlewares attached to the route.

Parameters
array $middleware
public getMiddleware():array
public where(string $name, $expression = null):Routing
Parameters
string $name
$expression

Router

Router service

Namespace

Plenty\Plugin\Routing

Methods

public get(string $uri, $action):Route

Register a new GET route with the router.

Parameters
string $uri
$action
public post(string $uri, $action):Route

Register a new POST route with the router.

Parameters
string $uri
$action
public put(string $uri, $action):Route

Register a new PUT route with the router.

Parameters
string $uri
$action
public patch(string $uri, $action):Route

Register a new PATCH route with the router.

Parameters
string $uri
$action
public delete(string $uri, $action):Route

Register a new DELETE route with the router.

Parameters
string $uri
$action
public options(string $uri, $action):Route

Register a new OPTIONS route with the router.

Parameters
string $uri
$action
public any(string $uri, $action):Route

Register a new route responding to all verbs.

Parameters
string $uri
$action
public match(array $methods, string $uri, $action):Route

Register a new route with the given verbs.

Parameters
array $methods
string $uri
$action
public middleware(string $name, string $class):Routing

Register a short-hand name for a middleware.

Parameters
string $name
string $class
public prepareResponse(Request
 $request, Response
 $response):Response

Create a response instance from the given value.

Parameters
Request $request
Response $response

ApiRouter

Api router service

Namespace

Plenty\Plugin\Routing

Methods

public version(array $version, $second, $third = null):void
Parameters
array $version
$second
$third
public get(string $uri, $action):Route

Register a new GET route with the router.

Parameters
string $uri
$action
public post(string $uri, $action):Route

Register a new POST route with the router.

Parameters
string $uri
$action
public put(string $uri, $action):Route

Register a new PUT route with the router.

Parameters
string $uri
$action
public patch(string $uri, $action):Route

Register a new PATCH route with the router.

Parameters
string $uri
$action
public delete(string $uri, $action):Route

Register a new DELETE route with the router.

Parameters
string $uri
$action
public options(string $uri, $action):Route

Register a new OPTIONS route with the router.

Parameters
string $uri
$action
public any(string $uri, $action):Route

Register a new route responding to all verbs.

Parameters
string $uri
$action
public resource(string $name, string $controller, array $options = []):void

Route a resource to a controller.

Parameters
string $name
string $controller
array $options
public match(array $methods, string $uri, $action):Route

Register a new route with the given verbs.

Parameters
array $methods
string $uri
$action

Build

CheckProcess

check process

Namespace

Plenty\Plugin\Build

Methods

public addError(string $message):void
Parameters
string $message

Events

Event

Event

Namespace

Plenty\Plugin\Events

Dispatcher

Dispatcher

Namespace

Plenty\Plugin\Events

Methods

public listen($event, $listener, int $priority):void

Register an event listener with the dispatcher.

Parameters
$event
$listener
int $priority
public hasListeners($event):bool

Determine if a given event has listeners.

Parameters
$event
public fire($event, array $payload = []):void

Fire an event and call the listeners.

Parameters
$event
array $payload
public forget($event):void

Remove a set of listeners from the dispatcher.

Parameters
$event
public static getPrefix():string

ShouldQueue

Class that allows plugin event listeners to be queued.

Namespace

Plenty\Plugin\Events

Error

HTTPException

Created by ptopczewski, 29.12.15 13:48 Class HTTPException

Namespace

Plenty\Plugin\Error

Methods

public __construct(string $statusCode, string $message, Exception
 $previous = null):void

HTTPException constructor.

Parameters
string $statusCode
string $message
Exception $previous

Mail

Contracts

MailerContract

Plugin Mailer Service

Namespace

Plenty\Plugin\Mail\Contracts

Methods

public sendHtml(string $html, $recipients, string $subject = "", array $cc = [], array $bcc = [], ReplyTo
 $replyTo = null):void

Send an email containing html

Parameters
string $html The HTML-String for the email body
$recipients Either a string containing a single email address or an array of strings containing multiple email addresses
string $subject Optional. The subject of the message
array $cc Optional. Array of strings containing email addresses which the message should be sent to as cc
array $bcc Optional. Array of strings containing email addresses which the message should be sent to as bcc
ReplyTo $replyTo Optional. ReplyToRecipient model with mailaddress and name attributes
public sendFromTwig(string $twigPath, array $data, $recipients, string $subject = "", array $altConfig = [], array $cc = [], array $bcc = [], ReplyTo
 $replyTo = null):void

Send an email that will get rendered by twig

Parameters
string $twigPath The path to the twig template file that should be used to render the mail. E.g.: 'PluginNamespace::mail.my_mail'
array $data An associative array of data that will be available to the twig template
$recipients Either a string containing a single email address or an array of strings containing multiple email addresses
string $subject Optional. The subject of the message
array $altConfig Optional. Alternative email config. If present MUST be an associative array with the keys 'host', 'port', 'username', 'password' and 'encryption'. It CAN optionally have a key 'from' to set the sender-address to something else than specified in the system config. If 'from' is missing, the system-wide configured sender-address is used.
array $cc Optional. Array of strings containing email addresses which the message should be sent to as cc
array $bcc Optional. Array of strings containing email addresses which the message should be sent to as bcc
ReplyTo $replyTo Optional. ReplyToRecipient model with mailaddress and name attributes
public sendFromMime(string $mimeMessage, $recipients, array $altConfig = [], array $cc = [], array $bcc = [], ReplyTo
 $replyTo = null):void

Send given message as email

Parameters
string $mimeMessage Complete email mime source header included
$recipients Either a string containing a single email address or an array of strings containing multiple email addresses
array $altConfig Optional. Alternative email config. If present MUST be an associative array with the keys 'host', 'port', 'username', 'password' and 'encryption'. It CAN optionally have a key 'from' to set the sender-address to something else than specified in the system config. If 'from' is missing, the system-wide configured sender-address is used.
array $cc Optional. Array of strings containing email addresses which the message should be sent to as cc
array $bcc Optional. Array of strings containing email addresses which the message should be sent to as bcc
ReplyTo $replyTo Optional. ReplyToRecipient model with mailaddress and name attributes

AwsSesContract

Plugin AWS Simple Email Service

Namespace

Plenty\Plugin\Mail\Contracts

Methods

public sendEmail(Email
 $email, AwsSesCredentials
 $credentials):EmailSenderResult

Composes an email message and immediately queues it for sending via AWS SES

Parameters
Email $email
AwsSesCredentials $credentials

Models

Email

the email model.

Namespace

Plenty\Plugin\Mail\Models

Properties

Type Name Description
array bccAddresses BCC email address
array ccAddresses CC email address
array toAddresses To email address
string senderAddress Sender email address
array replyToAddresses Reply to email address
string subject Email subject
string htmlBody HTML email body
string plainTextBody Plain text email body
string rawMessage MIME message, if set subject, html and plainText are ignored

Methods

public toArray()

Returns this model as an array.

AwsSesCredentials

the credential model for AWS SES client.

Namespace

Plenty\Plugin\Mail\Models

Properties

Type Name Description
string region AWS region e.g. eu-west-1
string accessKeyId User access key
string secretAccessKey User secret access key

Methods

public toArray()

Returns this model as an array.

EmailSenderResult

the email sender result model.

Namespace

Plenty\Plugin\Mail\Models

Properties

Type Name Description
int messageId
string message
int errorCode

Methods

public toArray()

Returns this model as an array.

ReplyTo

ReplyTo

Namespace

Plenty\Plugin\Mail\Models

Properties

Type Name Description
string mailAddress The mail address to reply.
string name The name to reply.

Methods

public toArray()

Returns this model as an array.

Templates

Extensions

Twig_Extension

Twig extension

Namespace

Plenty\Plugin\Templates\Extensions

Methods

public getName():string

Twig_SimpleFilter

Twig SimpleFilter

Namespace

Plenty\Plugin\Templates\Extensions

Twig_SimpleFunction

Twig SimpleFunction

Namespace

Plenty\Plugin\Templates\Extensions

Factories

TwigFactory

Twig Factory

Namespace

Plenty\Plugin\Templates\Factories

Methods

public register():void
public createSimpleFunction(string $name, $callable, array $params = []):Twig_SimpleFunction
Parameters
string $name
$callable
array $params An array of parameters
public createSimpleFilter(string $name, $callable, array $params = []):Twig_SimpleFilter
Parameters
string $name
$callable
array $params An array of parameters

Data

Contracts

PropertyDescriptor

describes properties of a Model

Namespace

Plenty\Plugin\Data\Contracts

Methods

public getPropertyInformation(string $modelClassName):array
Parameters
string $modelClassName

Resources

Resource

Namespace

Plenty\Plugin\Data\Contracts

Methods

public load(string $resourceName, array $options = []):ResourceInformation
Parameters
string $resourceName
array $options [optional]
public exists(string $resourceName):bool
Parameters
string $resourceName

Model

ResourceInformation

resource information

Namespace

Plenty\Plugin\Data\Model

Methods

public getPath():string
public getContentUrl():string
public getData():void

PropertyInformation

property information

Namespace

Plenty\Plugin\Data\Model

Methods

public getType():string
public getName():string
public getDescription():string

Item

SalesPrice

SalesPriceSearchRepository

foo

Namespace

Plenty\Legacy\Repositories\Item\SalesPrice

Methods

public search(SalesPriceSearchRequest
 $request):SalesPriceSearchResponse
Parameters
SalesPriceSearchRequest $request
public searchAll(SalesPriceSearchRequest
 $request):array
Parameters
SalesPriceSearchRequest $request

Variation

SalesPriceService

To be written...

Namespace

Plenty\Legacy\Services\Item\Variation

Methods

public getUnitPrice(float $lot, float $price, string $unit):array
Parameters
float $lot
float $price
string $unit

DetectSalesPriceService

To be written...

Namespace

Plenty\Legacy\Services\Item\Variation

Methods

public getQuantity():void
public setQuantity($quantity):DetectSalesPriceService
Parameters
$quantity
public getCurrency():void
public setCurrency($currency):DetectSalesPriceService
Parameters
$currency
public getPlentyId():void
public setPlentyId($plentyId):DetectSalesPriceService
Parameters
$plentyId
public getOrderReferrer():void
public setOrderReferrer($orderReferrer):DetectSalesPriceService
Parameters
$orderReferrer
public getCustomerClass():void
public setCustomerClass($customerClass):DetectSalesPriceService
Parameters
$customerClass
public getType():void
public setType($type):DetectSalesPriceService
Parameters
$type
public getCountryOfDelivery():void
public setCountryOfDelivery($countryOfDelivery):DetectSalesPriceService
Parameters
$countryOfDelivery
public getAccountType():void
public setAccountType($accountType):DetectSalesPriceService
Parameters
$accountType
public getAccountId():void
public setAccountId($accountId):DetectSalesPriceService
Parameters
$accountId
public detect():void

Models

Item

ItemImageSettings

Configuration of item images

Namespace

Plenty\Legacy\Models\Item

Properties

Type Name Description
int cdnUrl
int maxAge
int imageExportPos
int defaultExport
int ftpImport
int ftpImportMatching
int neckermannExport
int attributeImageWidth
int attributeImageHeight
array name
array placeholder
array sizes
array aliases
array legacyPreviousSizes

Methods

public toArray()

Returns this model as an array.

Repositories

Contracts

DeleteResponseContract

DeleteResponse Interface

Namespace

Plenty\Repositories\Contracts

Methods

public getAffectedRows():int
public setAffectedRows(int $value):void
Parameters
int $value
public increment():int
public decrement():int

PaginationResponseContract

Contract for PaginationResponse

Namespace

Plenty\Repositories\Contracts

Methods

public getTotal():void
public setTotal($total):void
Parameters
$total
public getPage():void
public setPage($page):void
Parameters
$page
public getEntriesPerPage():void
public setEntriesPerPage($epp):void
Parameters
$epp
public getResult():void
public setResult($entries):void
Parameters
$entries
public toJson(int $options):string

Convert the object to its JSON representation.

Parameters
int $options
public toArray():array

Get the instance as an array.

Models

DeleteResponse

Delete Response

Namespace

Plenty\Repositories\Models

Properties

Type Name Description
int affectedRows

Methods

public toArray()

Returns this model as an array.

PaginatedResult

paginated result

Namespace

Plenty\Repositories\Models

Methods

public getPage():int

Returns the page number as received

public getCurrentPage():int

Returns the normalized page number - checked if out of logical bounds ( not below 0, not greater than the last page ) and adjusted

public getTotalCount():int
public isLastPage():bool
public getItemIndexFrom():int
public getItemIndexTo():int
public getLastPage():int
public getResult():array
public setResult($result):void
Parameters
$result
public toArray():array

Get the instance as an array.

public toJson(int $options):string

Convert the object to its JSON representation.

Parameters
int $options
public jsonSerialize():void

Specify data which should be serialized to JSON

FilteredPaginatedResult

Filtered paginated result

Namespace

Plenty\Repositories\Models

Methods

public getFilters():array
public setFilters(array $filters):void
Parameters
array $filters
public toArray():array

Get the instance as an array.

public getPage():int

Returns the page number as received

public getCurrentPage():int

Returns the normalized page number - checked if out of logical bounds ( not below 0, not greater than the last page ) and adjusted

public getTotalCount():int
public isLastPage():bool
public getItemIndexFrom():int
public getItemIndexTo():int
public getLastPage():int
public getResult():array
public setResult($result):void
Parameters
$result
public toJson(int $options):string

Convert the object to its JSON representation.

Parameters
int $options
public jsonSerialize():void

Specify data which should be serialized to JSON

Criteria

PluginCriteria

The contract for defining criteria.

Namespace

Plenty\Repositories\Criteria

Methods

public comparisons():array
public apply($builder, CriteriableContract
 $repository):void
Parameters
$builder
CriteriableContract $repository
public allowedComparators():array

Comparison

comparison class

Namespace

Plenty\Repositories\Criteria

Methods

public getOperator():string
public getTerm():void
public isOperator(string $comparison):bool
Parameters
string $comparison
public castTerm(string $castTo):void
Parameters
string $castTo

Criteria

Contracts

CriteriableContract

Interface which provides the possibility to use Criteria filters.

Namespace

Plenty\Repositories\Criteria\Contracts

Methods

public clearCriteria():void

Resets all Criteria filters by creating a new instance of the builder object.

public applyCriteriaFromFilters():void

Applies criteria classes to the current repository.

ExtendsCriteriaContract

Interface which provides the possibility to extends repositories with new Criteria filters.

Namespace

Plenty\Repositories\Criteria\Contracts

Containers

CriteriaContainer

Register repository criteria

Namespace

Plenty\Repositories\Criteria\Containers

Methods

public add(string $repository, string $criteria, string $key):Containers

Use this method to add criteria to a existing repository.

Parameters
string $repository The repository that should use the criteria
string $criteria The criteria class name that should be used.
string $key The key that should match the given criteria.

Log

Contracts

LoggerContract

The contract for the logger.

Namespace

Plenty\Log\Contracts

Methods

public report(string $code, $additionalInfo = null):void

Report information.

Parameters
string $code
$additionalInfo
public debug(string $code, $additionalInfo = null):void

Detailed debug information.

Parameters
string $code
$additionalInfo
public info(string $code, $additionalInfo = null):void

Interesting events.

Parameters
string $code
$additionalInfo
public notice(string $code, $additionalInfo = null):void

Normal but significant events.

Parameters
string $code
$additionalInfo
public warning(string $code, $additionalInfo = null):void

Exceptional occurrences that are not errors.

Parameters
string $code
$additionalInfo
public error(string $code, $additionalInfo = null):void

Runtime errors that do not require immediate action but should typically be logged and monitored.

Parameters
string $code
$additionalInfo
public critical(string $code, $additionalInfo = null):void

Critical conditions.

Parameters
string $code
$additionalInfo
public alert(string $code, $additionalInfo = null):void

Action must be taken immediately.

Parameters
string $code
$additionalInfo
public emergency($code, $additionalInfo = null):void

System is unusable.

Parameters
$code
$additionalInfo
public logException(Exception
 $exception, int $traceDepth = 3):void

Log exceptions.

Parameters
Exception $exception
int $traceDepth The depth of the stack trace to be logged. Default is 3.
public setReferenceType(string $referenceType):LoggerContract

The reference type.

Parameters
string $referenceType
public setReferenceValue($referenceValue):LoggerContract

The reference value.

Parameters
$referenceValue
public addReference(string $referenceType, int $referenceValue):LoggerContract

Add reference.

Parameters
string $referenceType
int $referenceValue
public addPlaceholder(string $placeholderName, $placeholderValue):LoggerContract

Add code placeholder.

Parameters
string $placeholderName
$placeholderValue

Models

Log

The log entity model

Namespace

Plenty\Log\Models

Properties

Type Name Description
string id The ID of the log entry
string createdAt The date when the log entry was created
string integration The integration key used for the log entry. Used as a first level allocation.
string identifier The identifier used for the log entry. Used as a second level allocation.
string code The code for this current log entry. For log entries with level "debug", "info", "notice", "warning" and "report" this needs to have an translation in order to be stored.
string referenceType Deprecated field, see the references field instead.
referenceValue Deprecated field, see the references field instead.
string level The level this current log entry belongs to. Notice! When storing log entries with level "report" the entries will actually be stored as level "info". The difference between "report" and "info" is that log entries with level "report" do not need prior activation.
additionalInfo Additional information that need to also be stored. Can be an int, string or object.
string callerFunction
int callerLine
array references All the reference types and values correlated with this log entry.

Methods

public toArray()

Returns this model as an array.

Exceptions

ReferenceTypeException

Class ReferenceTypeException

Namespace

Plenty\Log\Exceptions

Methods

public __construct(string $message, int $code, Exception
 $previous = null):void
Parameters
string $message
int $code
Exception $previous

Services

ReferenceContainer

Register log reference types.

Namespace

Plenty\Log\Services

Methods

public add(array $referenceTypes):void

Use this method to add reference types.

Parameters
array $referenceTypes

Search

Contracts

LogRepositoryContract

Contract for logs.

Namespace

Plenty\Log\Search\Contracts

Methods

public search(int $page = 1, int $itemsPerPage = 50, array $filters = [], string $sortBy = "createdAt", string $sortOrder = "desc", array $with = []):FilteredPaginatedResult

Search logs with the given filters.

Parameters
int $page
int $itemsPerPage
array $filters
string $sortBy
string $sortOrder
array $with
public get($id):Log

Get log entry by id.

Parameters
$id

Validation

Contracts

Attribute

Attribute Interface

Namespace

Plenty\Validation\Contracts

Methods

public getAttributeName():string
public setAttributeName(string $attributeName):Contracts
Parameters
string $attributeName
public accepted():Contracts

The field under validation must be yes, on, 1, or true. This is useful for validating "Terms of Service" acceptance.

public customRule(string $rule, array $params):Contracts

Add custom Role

Parameters
string $rule
array $params
public activeUrl():Contracts

The field under validation must be a valid URL according to the checkdnsrr PHP function.

public dateAfter(string $fieldNameOrTimeStr):Contracts

The field under validation must be a value after a given date. The dates will be passed into the strtotime PHP function. Instead of passing a date string to be evaluated by strtotime, you may specify another field to compare against the date

Parameters
string $fieldNameOrTimeStr
public alphabetic():Contracts

The field under validation must be entirely alphabetic characters.

public alphaDash():Contracts

The field under validation may have alpha-numeric characters, as well as dashes and underscores.

public alphaNum():Contracts

The field under validation must be entirely alpha-numeric characters.

public isArray():Contracts

The field under validation must be a PHP array.

public dateBefore(string $fieldNameOrTimeStr):Contracts

The field under validation must be a value preceding the given date. The dates will be passed into the PHP strtotime function.

Parameters
string $fieldNameOrTimeStr
public between(int $min, int $max):Contracts

The field under validation must have a size between the given min and max. Strings, numerics, and files are evaluated in the same fashion as the size rule.

Parameters
int $min
int $max
public boolean():Contracts

The field under validation must be able to be cast as a boolean. Accepted input are true, false, 1, 0, "1", and "0".

public confirmed():Contracts

The field under validation must have a matching field of foo_confirmation. For example, if the field under validation is password, a matching password_confirmation field must be present in the input.

public present():Contracts

Validate that an attribute exists even if not filled.

public date():Contracts

The field under validation must be a valid date according to the strtotime PHP function.

public dateFormat(string $format):Contracts

The field under validation must match the given format. The format will be evaluated using the PHP date_parse_from_format function. You should use either date or date_format when validating a field, not both.

Parameters
string $format
public dateW3C(bool $allowTimestamps = false):Contracts

The field under validation must be a valid w3c formated date time string.

Parameters
bool $allowTimestamps Allow timestamps as a valid format as well.
public validPlentyId():Contracts

The field under validation must be a valid plentyId.

public typeFromDb(string $table, string $column, string $attribute, string $comparisonKey = "id"):Contracts

The field under validation must have the type specified in the database.

Parameters
string $table The table with the data type
string $column The column with the data type
string $attribute The attribute in the validator with the key
string $comparisonKey The column to in $table to compare $attribute to. Default is 'id'.
public hexColor():Attribute

The field under validation must be a valid HEX color (like "#a3d" or "#a0787c").

public rgbColor():Attribute

The field under validation must be a valid RGB or RGBA color (like "rgb(0, 200, 150)" or "rgba(0, 200, 150, 0.52)").

public cssColor():Attribute

The field under validation must be a valid predefined CSS color (like "aquamarine" or "skyblue").

public color():Attribute

The field under validation must be a valid color (HEX like "#a0787c", RGB like "rgb(0, 200, 150)" or CSS like "aquamarine")

public uuid5():Attribute

The field under validation must be a valid UUID version 5.

public validDbType():Contracts

The field under validation must be a valid data type used by the validation rule 'typeFromDb'.

public validCurrency():Contracts

The field under validation must be a valid currency string (e.g. 'EUR').

public different(string $fieldName):Contracts

The field under validation must have a different value than field.

Parameters
string $fieldName
public digits(int $count):Contracts

The field under validation must be numeric and must have an exact length of $count.

Parameters
int $count
public digitsBetween(int $min, int $max):Contracts

The field under validation must have a length between the given min and max.

Parameters
int $min
int $max
public email():Contracts

The field under validation must be formatted as an e-mail address.

public exists(string $table, array $columns = []):Contracts

The field under validation must exist on a given database table.

Parameters
string $table
array $columns
public image():Contracts

The file under validation must be an image (jpeg, png, bmp, gif, or svg)

public in(array $values):Contracts

The field under validation must be included in the given list of values.

Parameters
array $values
public integer():Contracts

The field under validation must be an integer.

public ip():Contracts

The field under validation must be an IP address.

public json():Contracts

The field under validation must a valid JSON string.

public max(int $value):Contracts

The field under validation must be less than or equal to a maximum value. Strings, numerics, and files are evaluated in the same fashion as the size rule.

Parameters
int $value
public mimeTypes(array $types):Contracts

The file under validation must have a MIME type corresponding to one of the listed extensions.

Parameters
array $types
public min(int $value):Contracts

The field under validation must have a minimum value. Strings, numerics, and files are evaluated in the same fashion as the size rule.

Parameters
int $value
public notIn($values):Contracts

The field under validation must not be included in the given list of values.

Parameters
$values
public numeric():Contracts

The field under validation must be numeric.

public regex(string $pattern):Contracts

The field under validation must match the given regular expression.

Parameters
string $pattern
public required():Contracts

The field under validation must be present in the input data and not empty. A field is considered "empty" is one of the following conditions are true: The value is null. The value is an empty string. The value is an empty array or empty Countable object. The value is an uploaded file with no path.

public requiredIf(string $fieldName, $value):Contracts

The field under validation must be present if the anotherfield field is equal to any value.

Parameters
string $fieldName
$value
public requiredUnless(string $fieldName, string $value):Contracts

The field under validation must be present unless the anotherfield field is equal to any value.

Parameters
string $fieldName
string $value
public requiredWith(array $fieldNames):Contracts

The field under validation must be present only if any of the other specified fields are present.

Parameters
array $fieldNames
public requiredWithAll(array $fieldNames):Contracts

required_with_all

Parameters
array $fieldNames
public requiredWithout(array $fieldNames):Contracts

The field under validation must be present only when any of the other specified fields are not present.

Parameters
array $fieldNames
public requiredWithoutAll(array $fieldNames):Contracts

The field under validation must be present only when all of the other specified fields are not present.

Parameters
array $fieldNames
public notLike(string $fieldName):Contracts

The field under validation must be not like the specified name.

Parameters
string $fieldName
public same(string $fieldName):Contracts

The given field must match the field under validation.

Parameters
string $fieldName
public size(int $value):Contracts

The field under validation must have a size matching the given value. For string data, value corresponds to the number of characters. For numeric data, value corresponds to a given integer value. For files, size corresponds to the file size in kilobytes.

Parameters
int $value
public string():Contracts

The field under validation must be a string.

public timezone():Contracts

The field under validation must be a valid timezone identifier according to the timezone_identifiers_list PHP function.

public unique(string $table, string $column, string $except = null, string $idColumn = null):Contracts

The field under validation must be unique on a given database table. If the column option is not specified, the field name will be used.

Parameters
string $table
string $column
string $except
string $idColumn
public url():Contracts

The field under validation must be a valid URL according to PHP's filter_var function.

public sometimes():Contracts

In some situations, you may wish to run validation checks against a field only if that field is present in the input array. To quickly accomplish this, add the sometimes rule.

public nullable():Contracts

The field under validation may be null. This is particularly useful when validating primitive such as strings and integers that can contain null values.

public validBoardTaskReferenceValue():Contracts

The field under validation must be a valid board task reference type (e.g. {@link BoardTaskReferenceType::CONTACT}).

Service

ValidatorFactory

Instantiates Validator Classes

Namespace

Plenty\Validation\Service

Methods

public create(string $validatorClass):Validator
Parameters
string $validatorClass The fully qualified classname of the validator to create (including namespace)

AttributeFactory

Instantiates Attribute Classes

Namespace

Plenty\Validation\Service

Methods

public create(string $which):Attribute
Parameters
string $which

Illuminate

Support

MessageBag

Namespace

Illuminate\Support

Collection

Namespace

Illuminate\Support

ServiceProvider

Namespace

Illuminate\Support

Carbon

Carbon

Namespace

Carbon

Properties

Type Name Description
year
yearIso
month
day
hour
minute
second
timestamp
timezone
tz

Database

Eloquent

Model

Abstract Model class

Namespace

Illuminate\Database\Eloquent

Collection

Namespace

Illuminate\Database\Eloquent

Component

HttpFoundation

Response

Namespace

Symfony\Component\HttpFoundation