Address

Contracts

AddressContactRelationRepositoryContract

The AddressContactRelationRepositoryContract is the interface for the address contact relation repository.

Namespace

Plenty\Modules\Account\Address\Contracts

Methods

public createAddressContactRelation(array $data):array

Creates address contact relations.

Parameters
array $data The address data as associative array
public updateAddressContactRelation(array $data):array

Updates address contact relations.

Parameters
array $data The data as associative array
public findAddressContactRelation(int $addressContactRelationId):AddressContactRelation

Gets address contact relation by ID.

Parameters
int $addressContactRelationId The ID of the address contact relation
public deleteAddressContactRelation(int $addressContactRelationId):bool

Deletes an address contact relation.

Parameters
int $addressContactRelationId The ID of the address contact relation
public listAddressContactRelations(array $filter = [], array $with = [], array $columns = [], int $page = 1, int $itemsPerPage = 50):PaginatedResult

Lists address contact relations.

Parameters
array $filter Filter that restricts the search result
array $with An array with child instances to be loaded
array $columns The columns to retrieve
int $page The page of results to search for
int $itemsPerPage The number of items to list per page
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.

AddressParamConfigurationRepositoryContract

The AddressParamConfigurationRepositoryContract is the interface for the address param configuration repository. This interface allows to create, update, delete, list and get address relation types and address option types.

Namespace

Plenty\Modules\Account\Address\Contracts

Methods

public createAddressRelationType(array $data):AddressRelationType

Create a new address relation type

Parameters
array $data
public updateAddressRelationType(array $data, int $addressRelationTypeId):AddressRelationType

Update an existing address relation type

Parameters
array $data
int $addressRelationTypeId
public deleteAddressRelationType(int $addressRelationTypeId):bool

Delete an address relation type by given id

Parameters
int $addressRelationTypeId
public findAddressRelationTypeById(int $addressRelationTypeId):AddressRelationType

Find an existing address relation type by given id

Parameters
int $addressRelationTypeId
public allAddressRelationTypes(array $columns = [], int $perPage = 50):void

Get list of address relation type

Parameters
array $columns
int $perPage
public createAddressOptionType(array $data):AddressOptionType

Create a new address option type

Parameters
array $data
public updateAddressOptionType(array $data, int $addressOptionTypeId):AddressOptionType

Update an existing address option type

Parameters
array $data
int $addressOptionTypeId
public deleteAddressOptionType(int $addressOptionTypeId):bool

Delete an address option type by given id

Parameters
int $addressOptionTypeId
public findAddressOptionTypeById(int $addressOptionTypeId):AddressOptionType

Find an existing address option type by given id

Parameters
int $addressOptionTypeId
public allAddressOptionType(array $columns = [], int $perPage = 50):void

Get list of address option type

Parameters
array $columns
int $perPage

AddressPosRelationRepositoryContract

The AddressPosRelationRepositoryContract is the interface for the address POS relation repository.

Namespace

Plenty\Modules\Account\Address\Contracts

Methods

public createAddressPosRelation(array $data):AddressPosRelation

Creates an address POS relation.

Parameters
array $data The address data as associative array
public updateAddressPosRelation(int $addressPosRelationId, array $data):AddressPosRelation

Updates an address POS relation.

Parameters
int $addressPosRelationId The ID of the address POS relation
array $data The data as associative array
public findAddressPosRelation(int $addressPosRelationId):AddressPosRelation

Lists address POS relations.

Parameters
int $addressPosRelationId The ID of the address POS relation
public deleteAddressPosRelation(int $addressPosRelationId):void

Deletes an address POS relation.

Parameters
int $addressPosRelationId The ID of the address POS relation
public listAddressPosRelations(array $filter = [], array $with = [], array $columns = [], int $page = 1, int $itemsPerPage = 50):PaginatedResult

Lists address POS relations.

Parameters
array $filter Filter that restricts the search result
array $with An array with child instances to be loaded
array $columns The columns to retrieve
int $page The page of results to search for
int $itemsPerPage The number of items to list per page
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.

AddressRepositoryContract

The AddressRepositoryContract is the interface for the address repository contract. This interface allows to get, update, create and delete addresses and address options.

Namespace

Plenty\Modules\Account\Address\Contracts

Methods

public findAddressById(int $addressId):Address

Gets an address. The ID of the address must be specified.

Parameters
int $addressId The ID of the address
public updateAddress(array $data, int $addressId):Address

Updates an address. The ID of the address must be specified.

Parameters
array $data The address data as associative array
int $addressId The ID of the address
public createAddress(array $data):Address

Creates an address.

Parameters
array $data The address data as associative array
public deleteAddress(int $addressId):bool

Deletes an address. The ID of the address must be specified.

Parameters
int $addressId The ID of the address
public getAddressesOfWarehouse(int $warehouseId, int $relationTypeId = null, array $columns = [], int $perPage = 50):Collection

Returns a collection of addresses linked with a warehouse.

Parameters
int $warehouseId The ID of the warehouse
int $relationTypeId The ID of the relation type
array $columns The columns to retrieve
int $perPage The quantity of the result
public createAddressOfWarehouse(array $data):Address

Creates an address and immediately links it with a warehouse.

Parameters
array $data The data to save
public findAddressOptions(int $addressId, int $typeId):Collection

Returns a collection of address options of an address.

Parameters
int $addressId The ID of the address
int $typeId (Optional) The ID of an address option type
public createAddressOptions(array $addressData, int $addressId):Collection

Creates address options for an address and returns all options of the address.

Parameters
array $addressData The address option data as associative array. Multiple options are possible.
int $addressId The ID of the address
public updateAddressOptions(array $addressData, int $addressId):Collection

Updates address options for an address and returns all options of the address.

Parameters
array $addressData The address option data as associative array. Multiple options are possible.
int $addressId The ID of the address
public deleteAddressOptions(int $addressId):void

Deletes all address options of an address. The ID of the address must be specified.

Parameters
int $addressId The ID of the address
public getAddressOption(int $optionId):AddressOption

Gets an address option. The ID of the option must be specified.

Parameters
int $optionId The ID of the address option
public updateAddressOption(array $optionData, int $optionId):AddressOption

Updates an address option. The ID of the address option must be specified.

Parameters
array $optionData The option data as associative array
int $optionId The ID of the address option
public deleteAddressOption(int $optionId):bool

Deletes an address option. The ID of the option must be specified. Returns true if deletion was successful. Returns false if deletion was not successful.

Parameters
int $optionId The ID of the address option
public findAddressRelationTypes(string $application, string $lang):Collection

Returns a collection of address relation types by a specific application and language. The collection may be empty.

Parameters
string $application The application type
string $lang The language as ISO 639-1 code (e.g. `en` for english).
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.

Models

Address

The address model

Namespace

Plenty\Modules\Account\Address\Models

Properties

Type Name Description
int id The ID of the address
string gender The gender (female or male)
string name1 The name 1 field (default: company name)
string name2 The name 2 field (default: first name)
string name3 The name 3 field (default: last name)
string name4 The name 4 field (default: c/o)
string companyName The company name (read only)
string firstName The first name (read only)
string lastName The last name (read only)
string careOf The c/o (read only)
string address1 The address 1 field (street|PACKSTATION|POSTFILIALE)
string address2 The address 2 field (house no|packstation id)
string address3 The address 3 field (additional)
string address4 The address 4 field is currently undefined and can be freely used.
string street The street (read only)
string houseNumber The house number (read only)
string additional The additional address information (read only)
string postalCode The postcode
string town The town
int countryId The ID of the country
int stateId The ID of the state
bool readOnly Flag that indicates if the data record is read only
string sessionId The session ID that was used when the address was created
checkedAt The time the address was checked as unix timestamp
createdAt The time the address was created as unix timestamp
updatedAt The time the address was last updated as unix timestamp
string taxIdNumber The taxIdNumber option
string externalId The externalId option
bool entryCertificate The entryCertificate option
string phone The phone option
string email The email option
string postident The PostIdent option
string fsk The age rating option
string birthday The birthday option
string personalNumber The personal number option
string packstationNo The packstation number
bool isPackstation Flag that indicates if the address is a packstation
bool isPostfiliale Flag that indicates if the address is a postfiliale (post office)
Collection options A collection of address options
Collection contacts A collection of contacts that are linked with the address record
Collection orders A collection of orders that are linked with the address record
Country country The address country
CountryState state The address state
Collection contactRelations A collection of relations to linked contacts
Collection orderRelations A collection of relations to linked orders
Collection warehouseRelations A collection of relations to linked warehouses
Collection reorderRelations A collection of relations to linked reorders
Collection schedulerRelations A collection of relations to linked schedulers

Methods

public toArray()

Returns this model as an array.

AddressContactRelation

The address contact relation model

Namespace

Plenty\Modules\Account\Address\Models

Properties

Type Name Description
int id The ID of the address contact relation
int contactId The ID of the contact
int typeId The type ID of the address. Possible values:
  • Invoice address = 1
  • Delivery address = 2
int addressId The ID of the address
bool isPrimary Flag that indicates if the address is primary
Address address The address of the relation
Contact contact The contact of the relation

Methods

public toArray()

Returns this model as an array.

AddressOption

The address options model

Namespace

Plenty\Modules\Account\Address\Models

Properties

Type Name Description
int id The ID of the address option
int addressId The ID of the address
int typeId The ID of the address option type
string value The option value
int position The position for sorting
Address address The address the option belongs to
AddressOptionType type The option type of the address option

Methods

public toArray()

Returns this model as an array.

AddressOptionType

The AddressOptionType model

Namespace

Plenty\Modules\Account\Address\Models

Properties

Type Name Description
int id The ID of the address option type. It is possible to define individual types. The following types are available by default:
  • 1 = VAT number
  • 2 = External address ID
  • 3 = Entry certificate
  • 4 = Telephone
  • 5 = Email
  • 6 = Post number
  • 7 = Personal id
  • 8 = BBFC (age rating)
  • 9 = Birthday
  • 10 = Session ID
  • 11 = Title
int position The position for sorting
int nonErasable Flag that indicates if the type can be deleted
Collection names A collection of address option type names
Collection options A collection of all address options of the type

Methods

public toArray()

Returns this model as an array.

AddressOptionTypeName

The AddressOptionTypeName model

Namespace

Plenty\Modules\Account\Address\Models

Properties

Type Name Description
int id The ID of the address option type name
int typeId The ID of the address option type
string lang The language of the name
string name The name
AddressOptionType type The address option type that belongs to the name

Methods

public toArray()

Returns this model as an array.

AddressOrderRelation

address order relation model

Namespace

Plenty\Modules\Account\Address\Models

Properties

Type Name Description
int id The ID of the address order relation
int orderId The ID of the order
int typeId The ID of the address type
  • Billing address = 1
  • Delivery address = 2
  • Sender address = 3
  • Return address = 4
  • Client address = 5
  • Contractor address = 6
  • Warehouse address = 7
int addressId The ID of the address
Address address The address of the relation
Order order The order of the relation

Methods

public toArray()

Returns this model as an array.

AddressPosRelation

The address POS relation model

Namespace

Plenty\Modules\Account\Address\Models

Properties

Type Name Description
int id The ID of the address POS relation
string posBaseId The ID of the POS base
string addressId The ID of the address
int typeId The ID of the relation type

Methods

public toArray()

Returns this model as an array.

AddressRelationType

The contact address type model

Namespace

Plenty\Modules\Account\Address\Models

Properties

Type Name Description
int id The ID of the address relation type. The following types are available by default and cannot be deleted:
  • 1 = Billing address
  • 2 = Delivery address
  • 3 = Sender address
  • 4 = Return address
  • 5 = Client address
  • 6 = Contractor address
  • 7 = Warehouse address
  • 8 = POS address
int position The position for sorting
int nonErasable Flag that indicates if the type can be deleted
Collection names A collection of AddressRelationTypeName objects
AddressRelationTypeApplication application The address relation type application

Methods

public toArray()

Returns this model as an array.

AddressRelationTypeApplication

The AddressRelationTypeApplication model

Namespace

Plenty\Modules\Account\Address\Models

Properties

Type Name Description
int id The ID of the address relation type name
int typeId The ID of the relation type
string application The application type. Allowed values: contact, order, warehouse.
int position The position for sorting
AddressRelationType type The type of the address relation

Methods

public toArray()

Returns this model as an array.

AddressRelationTypeName

The AddressRelationTypeName model

Namespace

Plenty\Modules\Account\Address\Models

Properties

Type Name Description
int id The ID of the address relation type name
int typeId The ID of the relation type
string lang The language of the name
string name The name
AddressRelationType type The type of the address relation

Methods

public toArray()

Returns this model as an array.

AddressSchedulerRelation

The AddressSchedulerRelation model

Namespace

Plenty\Modules\Account\Address\Models

Properties

Type Name Description
int id The ID of the address order relation
int schedulerId The ID of the scheduler
int typeId The ID of the address type
int addressId The ID of the address
OrderScheduler scheduler The scheduler of the order

Methods

public toArray()

Returns this model as an array.

AddressWarehouseRelation

The AddressWarehouseRelation model

Namespace

Plenty\Modules\Account\Address\Models

Properties

Type Name Description
int id The ID of the address warehouse relation
int warehouseId The ID of the warehouse
int typeId The ID of the type
int addressId The ID of the address
Address address The address of the relation

Methods

public toArray()

Returns this model as an array.

ContactEvent

Contracts

ContactEventRepositoryContract

The ContactEventRepositoryContract is the interface for the contact event repository. This interface allows to list contact events.

Namespace

Plenty\Modules\Account\Contact\ContactEvent\Contracts

Methods

public listEvents(array $columns = [], int $page = 1, int $itemsPerPage = 50):PaginatedResult

Lists contact events identified by the contact that is currently logged into the system.

Parameters
array $columns The columns to retrieve
int $page The page of results to search for
int $itemsPerPage The number of items to list per page
public listEventsByContactId(int $contactId, array $columns = [], int $page = 1, int $itemsPerPage = 50):PaginatedResult

Lists contact events by contact id.

Parameters
int $contactId
array $columns The columns to retrieve
int $page The page of results to search for
int $itemsPerPage The number of items to list per page
public createEvent(array $data):ContactEvent

Adds an entry to the table customer events by contact id.

Parameters
array $data
public updateEvent(int $contactEventId, array $data):ContactEvent

Updates an entry of the table customer events by contact event id.

Parameters
int $contactEventId
array $data
public deleteEvent(int $contactEventId):void

Deletes an entry of the table customer events by contact event id.

Parameters
int $contactEventId

Models

ContactEvent

The contact event model.

Namespace

Plenty\Modules\Account\Contact\ContactEvent\Models

Properties

Type Name Description
int eventId The ID of the event
int contactId The ID of the contact this event belongs to
int userId The ID of the user this event belongs to
int eventDuration The duration of the event in seconds
string eventType The type of the event. Possible values are call, ticket, email, meeting, webinar, development and design.
int orderRowId
string eventInfo Informational text about the event
bool billable Billable if set to 1
string eventInsertedAt The date the event was created at as unix timestamp
string eventBilledAt The date the event was billed at as unix timestamp
string eventProvisionPaidAt The date the provision was paid at as unix timestamp
float eventCreditValue The credit value of the event

Methods

public toArray()

Returns this model as an array.

Contact

Contracts

ContactAccessDataRepositoryContract

The ContactAccessDataRepositoryContract is the interface for the contact access data repository. This interface allows to reset and change contact password, get a login URL and unblock users.

Namespace

Plenty\Modules\Account\Contact\Contracts

Methods

public updatePassword(int $contactId, array $data):void

Updates a password for contact.

Parameters
int $contactId
array $data
public sendNewCustomerPassword(int $contactId):void
Parameters
int $contactId
public unblockUser(int $contactId):void
Parameters
int $contactId
public getLoginURL(int $contactId):void
Parameters
int $contactId

ContactAccountRepositoryContract

The ContactAccountRepositoryContract is the interface for the contact account repository. This interface allows to get, create, update and delete accounts. An account contains company-related data.

Namespace

Plenty\Modules\Account\Contact\Contracts

Methods

public findAccount(int $accountId, int $contactId):Account

Returns an account by an ID only if it is associated with the given contact ID.

Parameters
int $accountId The ID of the account
int $contactId The ID of the contact
public createAccount(array $data, int $contactId):Account

Creates an account and associates it immediately with the given ID of the contact.

Parameters
array $data The account data as associative array
int $contactId The ID of the contact to associate this to
public updateAccount(array $data, int $accountId, int $contactId):Account

Updates an account. If not already associated, it will associate the account with the given contact ID.

Parameters
array $data The account data as associative array
int $accountId The ID of the account
int $contactId The ID of the contact
public deleteAccount(int $accountId, int $contactId):bool

Deletes the given account of the given contact ID. Returns true if the deletion was successful. Returns false if the deletion was not successful.

Parameters
int $accountId The ID of the account
int $contactId The ID of the contact

ContactAddressRepositoryContract

The ContactAddressRepositoryContract is the interface for the contact address repository. This interface allows to list, get, create, update, add and delete addresses of the contact.

Namespace

Plenty\Modules\Account\Contact\Contracts

Methods

public findContactAddressByTypeId(int $contactId, int $typeId, bool $last = true):Address

Returns an address of a given contact for the given type.

Parameters
int $contactId The ID of the contact
int $typeId The ID of the address type
bool $last Return the last created billing address
public createAddress(array $data, int $contactId, int $typeId):Address

Creates an address, associates it immediately with the given contact ID with the given type and returns the new address.

Parameters
array $data The address data as associative array
int $contactId The ID of the contact
int $typeId The ID of the address type
public updateAddress(array $data, int $addressId, int $contactId, int $typeId):Address

Updates the existing address of a given contact and type and returns it.

Parameters
array $data The address data as associative array
int $addressId The ID of the address to update
int $contactId The ID of the contact
int $typeId The ID of the address type
public getAddress(int $addressId, int $contactId, int $typeId):Address

Returns the address of a given contact and type.

Parameters
int $addressId The ID of the address
int $contactId The ID of the contact
int $typeId The ID of the address type
public getAddresses(int $contactId, int $typeId = null):array

Gets all addresses for the given contact of the given type.

Parameters
int $contactId The ID of the contact
int $typeId The address type (default: all / null)
public addAddress(int $addressId, int $contactId, int $typeId):Address

Adds the address to the given contact as the given type.

Parameters
int $addressId The ID of the address
int $contactId The ID of the contact
int $typeId The ID of the address type
public setPrimaryAddress(int $addressId, int $contactId, int $addressTypeId):AddressContactRelation

Sets a contact address per address type as the primary address.

Parameters
int $addressId The ID of the address
int $contactId The ID of the contact
int $addressTypeId The ID of the address type
public resetPrimaryAddress(int $addressId, int $contactId, int $addressTypeId):AddressContactRelation

Resets a contact primary address.

Parameters
int $addressId The ID of the address
int $contactId The ID of the contact
int $addressTypeId The ID of the address type
public deleteAddress(int $addressId, int $contactId, int $typeId):bool

Deletes an existing address of a given contact and type. Returns true if deletion was successful. Returns false if deletion was not successful.

Parameters
int $addressId The ID of the address
int $contactId The ID of the contact
int $typeId The ID of the address type

ContactClassRepositoryContract

The ContactClassRepositoryContract is the interface for the contact class repository. This interface allows to list all contact classes or to get a contact class by the ID.

Namespace

Plenty\Modules\Account\Contact\Contracts

Methods

public findContactClassById(int $contactClassId):string

Gets a contact class. The ID of the contact class must be specified.

Parameters
int $contactClassId The ID of the contact class
public findContactClassDataById(int $contactClassId):array

Gets the data of a contact class. The ID of the contact class must be specified.

Parameters
int $contactClassId
public allContactClasses():array

Lists contact classes.

ContactGroupFunctionsRepositoryContract

The ContactGroupFunctionsRepositoryContract is the interface for the contact account group function repository. This interface allows to execute a group function call and get group function related data.

Namespace

Plenty\Modules\Account\Contact\Contracts

Methods

public loadGroupFunctions():array
public executeGroupFunction(array $contactList = [], int $addressLabelTemplate = null, int $emailTemplate = null, int $newsletter = null):array
Parameters
array $contactList
int $addressLabelTemplate
int $emailTemplate
int $newsletter

ContactLookupRepositoryContract

lookup repository for contacts

Namespace

Plenty\Modules\Account\Contact\Contracts

Methods

public hasId(int $contactId):ContactLookupRepositoryContract
Parameters
int $contactId
public hasEmail(string $emailAddress):ContactLookupRepositoryContract
Parameters
string $emailAddress
public hasBillingAddress(int $billingAddressId):ContactLookupRepositoryContract
Parameters
int $billingAddressId
public hasDeliveryAddress(int $deliveryAddressId):ContactLookupRepositoryContract
Parameters
int $deliveryAddressId
public lookup():array

ContactOptionRepositoryContract

The ContactOptionRepositoryContract is the interface for the contact option repository. This interface allows to get, create, update and delete contact options.

Namespace

Plenty\Modules\Account\Contact\Contracts

Methods

public findContactOptions(int $contactId, int $typeId, int $subTypeId):Collection

Lists options of the contact. The ID of the contact must be specified. The ID of the option type and the ID of the option sub-type can be optionally used.

Parameters
int $contactId The ID of the contact
int $typeId Optional: The ID of the option type (default: 0)
int $subTypeId Optional: The ID of the option sub-type (default: 0)
public createContactOptions(array $optionData, int $contactId):array

Creates an option for the given contact and returns them.

Parameters
array $optionData The option data as associative array
int $contactId The ID of the contact
public updateContactOptions(array $optionData, int $contactId):array

Updates options of the given contact and returns them. The ID of the contact must be specified.

Parameters
array $optionData The option data as associative array
int $contactId The ID of the contact
public deleteContactOptionsByContactId(int $contactId):bool

Deletes all options of the given contact. The ID of the contact must be specified. Returns true if deletion was successful. Returns false if deletion was not successful.

Parameters
int $contactId The ID of the contact
public findContactOption(int $optionId):ContactOption

Gets a contact option. The ID of the option must be specified.

Parameters
int $optionId The ID of the option
public updateContactOption(array $optionData, int $optionId):ContactOption

Updates an option with the given id and returns it.

Parameters
array $optionData The option data as associative array
int $optionId The ID of the option
public deleteContactOption(int $optionId):bool

Deletes a contact option. The ID of the option must be specified.

Parameters
int $optionId The ID of the option

ContactParamConfigurationContract

The ContactParamConfigurationContract is the interface for the contact param configuration repository. This interface allows to create, update, delete, list and get contact positions, contact departments, contact option types and and contact option sub types.

Namespace

Plenty\Modules\Account\Contact\Contracts

Methods

public createContactPosition(array $data):ContactPosition

Create a new contact position

Parameters
array $data
public updateContactPosition(array $data, int $contactPositionId):ContactPosition

Update an existing contact position

Parameters
array $data
int $contactPositionId
public deleteContactPosition(int $contactPositionId):bool

Delete an contact position by given id

Parameters
int $contactPositionId
public findContactPositionById(int $contactPositionId):ContactPosition

Find an existing contact position by given id

Parameters
int $contactPositionId
public allContactPositions(array $columns = [], int $perPage = 50):void

Get list of contact position

Parameters
array $columns
int $perPage
public createContactDepartment(array $data):ContactDepartment

Create a new contact department

Parameters
array $data
public updateContactDepartment(array $data, int $contactDepartmentId):ContactDepartment

Update an existing contact department

Parameters
array $data
int $contactDepartmentId
public deleteContactDepartment(int $contactDepartmentId):bool

Delete an contact department by given id

Parameters
int $contactDepartmentId
public findContactDepartmentById(int $contactDepartmentId):ContactDepartment

Find an existing contact department by given id

Parameters
int $contactDepartmentId
public allContactDepartments(array $columns = [], int $perPage = 50):void

Get list of contact department

Parameters
array $columns
int $perPage
public createContactOptionType(array $data):ContactOptionType

Create a new contact option type

Parameters
array $data
public updateContactOptionType(array $data, int $contactOptionTypeId):ContactOptionType

Update an existing contact option type

Parameters
array $data
int $contactOptionTypeId
public deleteContactOptionType(int $contactOptionTypeId):bool

Delete an contact option type by given id

Parameters
int $contactOptionTypeId
public findContactOptionTypeById(int $contactOptionTypeId):ContactOptionType

Find an existing contact option type by given id

Parameters
int $contactOptionTypeId
public allContactOptionType(array $columns = [], int $perPage = 50, array $with = []):void

Get list of contact option type

Parameters
array $columns
int $perPage
array $with
public createContactOptionSubType(array $data):ContactOptionSubType

Create a new contact option sub type

Parameters
array $data
public updateContactOptionSubType(array $data, int $contactOptionSubTypeId):ContactOptionSubType

Update an existing contact options sub type

Parameters
array $data
int $contactOptionSubTypeId
public deleteContactOptionSubType(int $contactOptionSubTypeId):bool

Delete an contact options sub type by given id

Parameters
int $contactOptionSubTypeId
public findContactOptionSubTypeById(int $contactOptionSubTypeId):ContactOptionSubType

Find an existing contact options sub type by given id

Parameters
int $contactOptionSubTypeId
public allContactOptionSubType(array $columns = [], int $perPage = 50):void

Get list of contact option sub type

Parameters
array $columns
int $perPage

ContactPaymentRepositoryContract

The ContactPaymentRepositoryContract is the interface for the contact payment repository. This interface allows to list, get, create, update and delete bank details of the contact.

Namespace

Plenty\Modules\Account\Contact\Contracts

Methods

public getBanksOfContact(int $contactId, array $columns = [], int $perPage = 50):array

Gets a collection of bank accounts of a contact. The ID of the contact must be specified.

Parameters
int $contactId The ID of the contact
array $columns Optional: The columns to retrieve (Default: '[*]')
int $perPage Optional: The number of bank accounts per page (Default: 50)
public getBankByOrderId(int $orderId, array $columns = []):ContactBank

Returns bank details of an order. The ID of the order must be specified.

Parameters
int $orderId The ID of the order
array $columns Optional: The columns to retrieve (Default: '[*]')
public createContactBank(array $data):ContactBank

Creates a bank account for a contact and returns it.

Parameters
array $data The bank account data as associative array
public updateContactBank(array $data, int $contactBankId):ContactBank

Updates a bank account. The ID of the bank account must be specified.

Parameters
array $data The bank data as associative array
int $contactBankId The ID of the bank account entry
public deleteContactBank(int $contactBankId):bool

Deletes a bank account. The ID of the bank account must be specified. Returns true if deletion was successful. Returns false if deletion was not successful.

Parameters
int $contactBankId The ID of the bank account entry
public findContactBankById(int $contactBankId):ContactBank

Gets a bank account. The ID of the bank account must be specified.

Parameters
int $contactBankId The ID of the bank account entry

ContactRepositoryContract

The ContactRepositoryContract is the interface for the contact repository. This interface allows to list, get, create, update and delete contacts. A contact is equivalent to a person.

Namespace

Plenty\Modules\Account\Contact\Contracts

Methods

public createContact(array $data):Contact

Creates a contact and returns it.

Parameters
array $data The contact data as associative array
public updateContact(array $data, int $contactId):Contact

Updates a contact and returns it. The ID of the contact must be specified.

Parameters
array $data The contact data as associative array
int $contactId The ID of the contact
public deleteContact(int $contactId, bool $checkExistingOrders = null):bool

Deletes a contact. The ID of the contact must be specified.

Parameters
int $contactId The ID of the contact. Returns `true` if deletion was successful. Returns `false` if deletion was not successful.
bool $checkExistingOrders Flag that checks if the contact is linked to orders. If the contact is linked to orders, CustomerDeleteException is thrown and the contact will not be deleted.
public findContactById(int $contactId, array $with = []):Contact

Gets a contact. The ID of the contact must be specified.

Parameters
int $contactId The ID of the contact
array $with The relationships that should be eager loaded
public getContactList(array $filter = [], array $with = [], array $columns = [], int $page = 1, int $itemsPerPage = 50, string $sortBy = "id", string $sortOrder = "desc"):PaginatedResult

List contacts

Parameters
array $filter Filter that restrict the search result
array $with The relationships that should be eager loaded
array $columns The columns to retrieve
int $page The page of results to search for
int $itemsPerPage The number of items to list per page
string $sortBy [optional, default=id]
string $sortOrder [optional, default=desc]
public getContactByOptionValue(string $value, int $typeId, int $subTypeId):Contact

Returns an existing contact by a contact option information.

Parameters
string $value The value of the contact option
int $typeId The type ID of the contact option
int $subTypeId The sub-type ID of the contact option
public getContactIdByEmail(string $email):int

Returns a contact id by email. The email must be specified.

Parameters
string $email
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.

public setFilters(array $filters = []):void

Sets the filter array.

Parameters
array $filters
public getFilters():void

Returns the filter array.

public getConditions():void

Returns a collection of parsed filters as Condition object

public clearFilters():void

Clears the filter array.

ContactTypeRepositoryContract

The ContactTypeRepositoryContract is the interface for the contact type repository. This interface allows to list, get, create, update and delete contact types.

Namespace

Plenty\Modules\Account\Contact\Contracts

Methods

public createContactType(array $data):ContactType

Creates a contact type and returns it.

Parameters
array $data The contact type data as associative array
public updateContactType(array $data, int $contactTypeId):ContactType

Updates a contact type and returns it. The ID of the contact type must be specified.

Parameters
array $data The contact type data as associative array
int $contactTypeId The ID of the contact type
public deleteContactType(int $contactTypeId):bool

Deletes a contact type. The ID of the contact type must be specified. Returns true if deletion was successful. Returns false if deletion was not successful.

Parameters
int $contactTypeId The ID of the contact type
public findContactTypeById(int $contactTypeId):ContactType

Gets a contact type. The ID of the contact type must be specified.

Parameters
int $contactTypeId The ID of the contact type
public allContactTypes(array $columns = []):array

Returns a collection of contact types.

Parameters
array $columns Optional: The columns to return as an array (Default: '[*]')

InternalContactPaymentRepositoryContract

The contract for the contact payment repository.

Namespace

Plenty\Modules\Account\Contact\Contracts

Methods

public getBanksOfContact(int $contactId, array $columns = [], int $perPage = 50):array

Gets a collection of bank accounts of a contact. The ID of the contact must be specified.

Parameters
int $contactId The ID of the contact
array $columns Optional: The columns to retrieve (Default: '[*]')
int $perPage Optional: The number of bank accounts per page (Default: 50)
public getBankByOrderId(int $orderId, array $columns = []):ContactBank

Returns bank details of an order. The ID of the order must be specified.

Parameters
int $orderId The ID of the order
array $columns Optional: The columns to retrieve (Default: '[*]')
public createContactBank(array $data):ContactBank

Creates a bank account for a contact and returns it.

Parameters
array $data The bank account data as associative array
public updateContactBank(array $data, int $contactBankId):ContactBank

Updates a bank account. The ID of the bank account must be specified.

Parameters
array $data The bank data as associative array
int $contactBankId The ID of the bank account entry
public deleteContactBank(int $contactBankId):bool

Deletes a bank account. The ID of the bank account must be specified. Returns true if deletion was successful. Returns false if deletion was not successful.

Parameters
int $contactBankId The ID of the bank account entry
public findContactBankById(int $contactBankId):ContactBank

Gets a bank account. The ID of the bank account must be specified.

Parameters
int $contactBankId The ID of the bank account entry

Models

Contact

The contact model.

Namespace

Plenty\Modules\Account\Contact\Models

Properties

Type Name Description
int id The ID of the contact
string externalId The external ID of the contact
string number The number of the contact (previous customer number)
int typeId The ID of the contact type
string firstName The first name of the contact
string lastName The last name of the contact
string fullName The full name of the contact. A concatenation of first and last name.
string email The private email address of the contact
string secondaryEmail The secondary private email address of the contact
string gender The gender of the contact
string title The title of the contact, e.g. a doctorate
string formOfAddress The form of address for the contact
newsletterAllowanceAt The time the contact registered for the newsletter as unix timestamp
int classId The ID of the contact class
int blocked The blocked status of the contact. Contacts can be blocked for a specific client (store). Possible values:
  • 0 = not blocked
  • 1 = blocked
int rating The rating of the contact. This rating is for internal use only. 5 red stars are for the worst and 5 yellow stars for the best rating. Possible values:
  • -5 = 5 red stars (worst rating)
  • -4 = 4 red stars
  • -3 = 3 red stars
  • -2 = 2 red stars
  • -1 = 1 red star
  • 0 = 5 grey stars, no rating saved for the contact
  • 1 = 1 yellow star
  • 2 = 2 yellow stars
  • 3 = 3 yellow stars
  • 4 = 4 yellow stars
  • 5 = 5 yellow stars (best rating)
string bookAccount The book account (debtor account) of the contact. An additional, separate number that generally corresponds to the customer number or the debtor number in your financial accounting.
string lang The language of the contact
float referrerId The origin of the contact
int plentyId The client (store) that is assigned to the contact
int userId The owner ID of the contact
birthdayAt The date of birth of the contact
lastLoginAt The date of the last login of the contact
lastLoginAtTimestamp The date of the last login of the contact
lastOrderAt The date of the last order
createdAt The date the contact was created
updatedAt The date the contact was last updated
string privatePhone The private phone number of the contact
string privateFax The private fax number of the contact
string privateMobile The private mobile phone number of the contact
string ebayName The eBay account name of the contact
string paypalEmail The email address of the PayPal account of the contact
string paypalPayerId The PayPal payer id of the contact
string klarnaPersonalId The Klarna personal id of the contact
string dhlPostIdent The DHL PostIdent of the contact
string forumUsername The user name of the contact in the forum
string forumGroupId The ID of the forum group that is assigned to the contact
string singleAccess The access type of the contact
string contactPerson The contact person of the contact
string marketplacePartner The marketplace partner status of the contact
Collection addresses A collection of linked addresses
Collection primaryBillingAddress A collection of linked primary billing addresses
Collection accounts A collection of linked accounts. An ID or a company name must be specified. When the ID is used, a relation will be created. When the company name without an ID is used, a new account with the given data will be created.
Collection orders A collection of orders of the contact
Collection banks A collection of bank accounts of the contact
Collection reorders A collection of reorders of the contact
Collection orderSchedulers A collection of order schedulers of the contact
Collection options A collection of options of the contact
Collection allowedMethodsOfPayment A collection of allowed payment methods for the contact.*
ContactType type The type of the contact
OrderSummary orderSummary The order summary of the contact

Methods

public toArray()

Returns this model as an array.

ContactAllowedMethodOfPayment

The model of the allowed payment method for the contact

Namespace

Plenty\Modules\Account\Contact\Models

Properties

Type Name Description
int id The ID of the payment method allowed for the contact
int contactId The ID of the contact
int methodOfPaymentId The ID of the payment method
int allowed Allowed payment method for the contact. Possible values are:
  • 0 = not allowed
  • 1 = allowed
string createdAt Timestamp when the payment method was created
string updatedAt Timestamp when the payment method was last updated
bool isPaymentActive Flag that indicates if the current payment method is active

Methods

public toArray()

Returns this model as an array.

ContactBank

The contact bank model.

Namespace

Plenty\Modules\Account\Contact\Models

Properties

Type Name Description
int id The ID of the bank account
int contactId The ID of the contact the bank account belongs to
int orderId The ID of the order the bank account belongs to
string accountOwner The owner of the bank account
string bankName The name of the bank
string bankAddress The address of the bank
string bankPostalCodeTown The postcode and town of the bank
string bankCountry The country of the bank
string iban The IBAN of the bank account
string bic The BIC of the bank account
string accountNumber The account number of the bank account
string sortCode The sort code of the bank account
string lastUpdateBy The source of the last change (possible values: `customer`, `backend`, `import`)
int directDebitMandateAvailable Flag that indicates if a direct debit mandate is available
string directDebitMandateAt The time the direct debit mandate was created as unix timestamp
string directDebitMethod The direct debit method (possible values: `sepaDirectDebit`, `sepaB2bDirectDebit`)
string directDebitType The direct debit type (possible values: `first`, `next`)
string paymentMethod The payment method (possible values: `recurrent`, `onOff`)
string createdAt The time the bank account was created as unix timestamp
string updatedAt The time the bank account was last updated as unix timestamp
Contact contact The contact the bank account belongs to
Order order The order the bank account belongs to

Methods

public toArray()

Returns this model as an array.

ContactDepartment

contact department model

Namespace

Plenty\Modules\Account\Contact\Models

Properties

Type Name Description
int id The ID of the contact department. It is possible to define individual departments. The following departments are available by default.
  • 1 = Management
  • 2 = Purchasing Department
  • 3 = Sales Department
  • 4 = Research & Development Team
  • 5 = Production
  • 6 = Quality Assurance
  • 7 = Public Relations
  • 8 = Marketing Department
  • 9 = IT Department
  • 10 = EDP Team
  • 11 = Logistics
  • 12 = Warehousing Department
  • 13 = Export Department
  • 14 = Import Department
  • 15 = Customer Service
  • 16 = Technical Support Team
  • 17 = Human Resources
  • 18 = Accounting Department
  • 19 = Financial Department
  • 20 = Legal Department
  • 21 = Secretary's Office
int position The position for sorting
array names List of contact department names

Methods

public toArray()

Returns this model as an array.

ContactDepartmentName

contact department name model

Namespace

Plenty\Modules\Account\Contact\Models

Properties

Type Name Description
int id The ID of the contact department name
int departmentId The ID of the department
string lang The language
string name The name

Methods

public toArray()

Returns this model as an array.

ContactOption

The contact options model.

Namespace

Plenty\Modules\Account\Contact\Models

Properties

Type Name Description
int id The ID of the contact option
int contactId The ID of the contact the option belongs to
int typeId The type ID of the contact option. It is possible to define individual contact option types. The following types are available by default and cannot be deleted:
  • 1 = Telephone
  • 2 = Email
  • 3 = Telefax
  • 4 = Web page
  • 5 = Marketplace
  • 6 = Identification number
  • 7 = Payment
  • 8 = User name
  • 9 = Group
  • 10 = Access
  • 11 = Additional
int subTypeId The sub-type ID of the contact option. It is possible to define individual contact option sub-types. The following types are available by default and cannot be deleted:
  • 1 = Work
  • 2 = Mobile private
  • 3 = Mobile work
  • 4 = Private
  • 5 = PayPal
  • 6 = Ebay
  • 7 = Amazon
  • 8 = Klarna
  • 9 = DHL
  • 10 = Forum
  • 11 = Guest
  • 12 = Contact person
  • 13 = Marketplace partner
string value The value of the option. Depends on the type/sub-type.
int priority The priority for sorting
string createdAt The time the option was created as unix timestamp
string updatedAt The time the option was last updated as unix timestamp
Contact contact The contact the option belongs to
ContactOptionType type The type of the option
ContactOptionSubType subType The sub-type of the option

Methods

public toArray()

Returns this model as an array.

ContactOptionSubType

contact options sub type model

Namespace

Plenty\Modules\Account\Contact\Models

Properties

Type Name Description
int id The ID of the contact option sub-type. It is possible to define individual option sub-types. The following types are available by default and cannot be deleted.
  • 1 = Work
  • 2 = Mobile private
  • 3 = Mobile work
  • 4 = Private
  • 5 = PayPal
  • 6 = Ebay
  • 7 = Amazon
  • 8 = Klarna
  • 9 = DHL
  • 10 = Forum
  • 11 = Guest
  • 12 = Contact person
  • 13 = Marketplace partner
int position The position for sorting
int nonErasable Flag that indicates if the option sub-type can be deleted
Collection names A collection of names in different languages for the option sub-type.

Methods

public toArray()

Returns this model as an array.

ContactOptionSubTypeName

contact options sub type name model

Namespace

Plenty\Modules\Account\Contact\Models

Properties

Type Name Description
int id The ID of the contact option sub type name entry
int subTypeId The ID of the option sub-type the name entry belongs to
string lang lang The language of the sub-type name
string name name The name of the sub-type

Methods

public toArray()

Returns this model as an array.

ContactOptionType

contact options type model

Namespace

Plenty\Modules\Account\Contact\Models

Properties

Type Name Description
int id The ID of the contact option type. It is possible to define individual option types. The following types are available by default and cannot be deleted.
  • 1 = Telephone
  • 2 = Email
  • 3 = Telefax
  • 4 = Web page
  • 5 = Marketplace
  • 6 = Identification number
  • 7 = Payment
  • 8 = User name
  • 9 = Group
  • 10 = Access
  • 11 = Additional
int position The position for sorting
int nonErasable Flag that indicates if the option type can be deleted
Collection names A collection of names in different languages for the option type

Methods

public toArray()

Returns this model as an array.

ContactOptionTypeName

The ContactOptionTypeName model

Namespace

Plenty\Modules\Account\Contact\Models

Properties

Type Name Description
int id The ID of the contact option type name
int typeId The ID of the option type the name belongs to
string lang The language of the option type name
string name The name of the option type

Methods

public toArray()

Returns this model as an array.

ContactPosition

The ContactPosition model

Namespace

Plenty\Modules\Account\Contact\Models

Properties

Type Name Description
int id The ID of the contact position. It is possible to define individual contact positions. The following positions are available by default:
  • 1 = Analyst
  • 2 = Director of Boards
  • 3 = CEO
  • 4 = Buyer
  • 5 = Purchasing Manager
  • 6 = CFO
  • 7 = Director General
  • 8 = Managing Director
  • 9 = Codirector
  • 10 = Commercial Agent
  • 11 = Assistant
  • 12 = Service Engineer
  • 13 = Warehouse Manager
  • 14 = Warehouse Worker
  • 15 = Senior Executive
  • 16 = Assistent
  • 17 = Purchasing Assistent
  • 18 = Software Developer
  • 19 = Sales Representative
  • 20 = Sales Manager
  • 21 = Export Sales Manager
  • 22 = Wholesale Distributing Manager
  • 23 = Secretary
  • 24 = Economist
  • 25 = Management Board
int position The position for sorting
array names The list of contact position names

Methods

public toArray()

Returns this model as an array.

ContactPositionName

The ContactPositionName model

Namespace

Plenty\Modules\Account\Contact\Models

Properties

Type Name Description
int id The ID of the contact position name
int positionId The ID of the position
string lang The language
string name The name

Methods

public toArray()

Returns this model as an array.

ContactType

The ContactType model

Namespace

Plenty\Modules\Account\Contact\Models

Properties

Type Name Description
int id The ID of the contact type. It is possible to define individual contact types. The following types are available by default and cannot be deleted.
  • 1 = Customer
  • 2 = Sales lead/Interested party
  • 3 = Sales representative
  • 4 = Supplier
  • 5 = Producer/Manufacturer
  • 6 = Partner
int position The position for sorting
int nonErasable Flag that indicates if the type can be deleted
Collection names A collection of contact type names in different languages
Collection contacts A collection of contacts with the type

Methods

public toArray()

Returns this model as an array.

ContactTypeName

contact type name model

Namespace

Plenty\Modules\Account\Contact\Models

Properties

Type Name Description
int id The ID of the contact type name
int typeId The contact type ID. See also {@link ContactType::id}.
string lang The language ot the contact type name
string name The contact type name

Methods

public toArray()

Returns this model as an array.

Search

Contracts

ContactElasticSearchAvailibilityRepositoryContract

ContactElasticSearchAvailibilityRepositoryContract

Namespace

Plenty\Modules\Account\Contact\Search\Contracts

Methods

public isReady():bool
public isAvailable():bool

ContactElasticSearchScrollRepositoryContract

kommt noch

Namespace

Plenty\Modules\Account\Contact\Search\Contracts

Methods

public hasNext():bool
public setNumberOfDocumentsPerShard(int $size):void
Parameters
int $size
public setIndex(IndexInterface
 $index):ElasticSearchSearchRepositoryContract
Parameters
IndexInterface $index
public addSearch($search):ElasticSearchSearchRepositoryContract
Parameters
$search
public execute():array

IndexContactRepositoryContract

The contract for the search repository

Namespace

Plenty\Modules\Account\Contact\Search\Contracts

Methods

public index(int $contactId):array

Index a contact

Parameters
int $contactId
public delete(array $contactIds):array

Delete contact from index

Parameters
array $contactIds
public bulk(array $contactIds):array
Parameters
array $contactIds
public setOutput(OutputInterface
 $output):void
Parameters
OutputInterface $output
public execute():void

Account

Contracts

AccountContactRelationRepositoryContract

The AccountContactRelationRepositoryContract is the interface for the account contact relation repository. This interface allows to find and delete an account contact relation.

Namespace

Plenty\Modules\Account\Contracts

Methods

public findAccountContactRelationById(int $accountContactRelation):AccountContactRelation

Gets an account contact releation. The ID of the account contact relation must be specified.

Parameters
int $accountContactRelation The ID of the account contact relation
public deleteAccountContactRelation(int $accountContactRelationId):bool

Deletes an account contact relation. The ID of the account contact relation must be specified.

Parameters
int $accountContactRelationId The ID of the account contact relation

AccountRepositoryContract

The AccountRepositoryContract is the interface for the account repository. This interface allows to list, get, create, update and delete accounts. An account contains company-related data. It is also possible to list all contacts of an account.

Namespace

Plenty\Modules\Account\Contracts

Methods

public createAccount(array $data):Account

Creates a new account and returns it.

Parameters
array $data The account data as associative array
public updateAccount(array $data, int $accountId):Account

Updates an existing account and returns it. The ID of the account must be specified.

Parameters
array $data The account data as associative array
int $accountId The ID of the account
public deleteAccount(int $accountId):bool

Deletes an account. The ID of the account must be specified. Returns true if deletion was successful. Returns false if deletion was not successful.

Parameters
int $accountId The ID of the account
public findAccountById(int $accountId):Account

Gets an account. The ID of the account must be specified.

Parameters
int $accountId The ID of the account
public allAccounts(array $columns = [], int $perPage = 50):Collection

Returns a collection of all accounts.

Parameters
array $columns Optional: The columns to retrieve (Default: '[*]').
int $perPage Optional: The number of objects per page (Default: 50).
public allAccountsPaginated(array $columns = [], int $page = 1, int $itemsPerPage = 50, array $with = []):PaginatedResult

Returns a collection of all accounts.

Parameters
array $columns Optional: The columns to retrieve (Default: '[*]').
int $page Optional: The number of the page (Default: 1).
int $itemsPerPage Optional: The number of objects per page (Default: 50).
array $with Optional: The relationships that should be eager loaded.
public getContactsOfAccount(int $accountId):Collection

Returns a collection of contacts that belong to the account.

Parameters
int $accountId The ID of the account
public saveAccount(array $data = []):void

Creates a new or updates an existing account.

Parameters
array $data The account data as associative array

Events

FrontendUpdateCustomerSettings

frontend customer settings event

Namespace

Plenty\Modules\Account\Events

Methods

public getDeliveryCountryId():int
public setDeliveryCountryId(int $deliveryCountryId):FrontendUpdateCustomerSettings
Parameters
int $deliveryCountryId
public getShowNetPrice():bool
public setShowNetPrice(bool $showNetPrice):FrontendUpdateCustomerSettings
Parameters
bool $showNetPrice
public getEbaySellerAccount():string
public setEbaySellerAccount(string $ebaySellerAccount):FrontendUpdateCustomerSettings
Parameters
string $ebaySellerAccount
public getAccountContactSign():string
public setAccountContactSign(string $accountContactSign):FrontendUpdateCustomerSettings
Parameters
string $accountContactSign
public getAccountContactClassId():int
public setAccountContactClassId(int $accountContactClassId):FrontendUpdateCustomerSettings
Parameters
int $accountContactClassId
public getSalesAgent():string
public setSalesAgent(string $salesAgent):FrontendUpdateCustomerSettings
Parameters
string $salesAgent
public getAccountContractClassId():int
public setAccountContractClassId(int $accountContractClassId):FrontendUpdateCustomerSettings
Parameters
int $accountContractClassId

Models

Account

the account model.

Namespace

Plenty\Modules\Account\Models

Properties

Type Name Description
int id The ID of the account
string number The number of the account
string companyName The company name
string taxIdNumber The ID of the tax number
int valuta The valuta date in days specified for the account
int discountDays The early payment discount period in days specified for the account
float discountPercent The early payment discount in percent specified for the account
int timeForPaymentAllowedDays The payment due date in days specified for the account
int salesRepresentativeContactId The contact ID of the sales representative
int userId The ID of the account owner
int deliveryTime The delivery time for the supplier
float dealerMinOrderValue The minimum order value for the supplier
createdAt The time the account was created as unix timestamp
updatedAt The time the account was last updated as unix timestamp
Collection contacts A list of contacts that belong to the account

Methods

public toArray()

Returns this model as an array.

AccountContactRelation

account contact relation model

Namespace

Plenty\Modules\Account\Models

Properties

Type Name Description
int id The ID of the account contact relation
int accountId The ID of the foreign key account
int contactId The ID of the foreign key contact
Account account The account of the relation
Contact contact The contact of the relation

Methods

public toArray()

Returns this model as an array.

Newsletter

Contracts

NewsletterRepositoryContract

The NewsletterRepositoryContract is the interface for the newsletter repository. This interface allows to assign email addresses of recipients to email folders. Depending on the settings selected for each email folder, different newsletters can be sent to different target groups.

Namespace

Plenty\Modules\Account\Newsletter\Contracts

Methods

public createEntry(array $data = []):Entry

Creates an entry.

Parameters
array $data
public createRecipient(array $data = []):array

Creates a recipient for an existing folder.

Parameters
array $data
public createFolder(array $data = []):Folder

Creates a folder.

Parameters
array $data
public deleteAllEntries():array

Delete all entries

public deleteAllFolders():array

Delete all folders

public deleteAllRecipients():array

Delete all recipients

public deleteEntryById(int $entryId):Entry

Deletes an entry. The ID of the entry must be specified.

Parameters
int $entryId
public deleteFolderById(int $folderId):Folder

Deletes a folder. The ID of the folder must be specified.

Parameters
int $folderId
public deleteRecipientById(int $recipientId):Recipient

Deletes a recipient. The ID of the recipient must be specified.

Parameters
int $recipientId
public listAllEntries():array

Lists all newsletter entries

public listAllFolders():array

Lists all newsletter folders

public listAllRecipients(array $data = []):array

Lists all recipients

Parameters
array $data
public listEntryById(int $entryId):Entry

Shows details from entry

Parameters
int $entryId
public listFolderById(int $folderId):Folder

Shows details from folder

Parameters
int $folderId
public listRecipientById(int $recipientId):Recipient

Shows details from recipient

Parameters
int $recipientId
public updateEntryById(int $entryId, array $data = []):Entry

Updates an entry. The ID of the entry must be specified.

Parameters
int $entryId
array $data
public updateFolderById(int $folderId, array $data = []):Folder

Updates a folder. The ID of the folder must be specified.

Parameters
int $folderId
array $data
public updateRecipientById(int $recipientId, array $data = []):Recipient

Updates a recipient. The ID of the recipient must be specified.

Parameters
int $recipientId
array $data
public addToNewsletterList(string $email, string $forename = "", string $surname = "", array $emailDirIds = []):void

Deprecated!

This method will not be supported in the future. Please refrain from using it as soon as possible.

Adds the email address of a contact or an interested party to an email folder for the newsletter list.

Parameters
string $email The email address of the contact or interested party who subscribed to the newsletter
string $forename The first name of the contact or interested party
string $surname The last name of the contact or interested party
array $emailDirIds The IDs of the email folders. The email addresses of the contacts and interested parties must be saved in the folders. This will allow to send different newsletters to different target groups.

Models

Entry

The newsletter entry model.

Namespace

Plenty\Modules\Account\Newsletter\Models

Properties

Type Name Description
string subject The subject of the newsletter entry
string body The body of the newsletter entry
string kind The type of the newsletter entry
string log The log of the newsletter entry

Methods

public toArray()

Returns this model as an array.

Folder

The newsletter folder model.

Namespace

Plenty\Modules\Account\Newsletter\Models

Properties

Type Name Description
int id The ID of the newsletter folder
string name The name of the newsletter folder
bool isDeletable Flag that indicates if the newsletter folder can be deleted. The folders 'Customers' and 'Interested parties' are available by default and cannot be deleted.
int position The position of the newsletter folder
bool isSelectable Flag that indicates if the newsletter folder can be selected by customers in the online store. If this is allowed, the folder will be displayed in the My account area of the online store. Customers will then be able to subscribe to the newsletters that are included in this folder.

Methods

public toArray()

Returns this model as an array.

NewsletterEmail

NewsletterEmail

Namespace

Plenty\Modules\Account\Newsletter\Models

Properties

Type Name Description
int id The ID of the newsletter email
int directory The ID of the directory
int customerId The ID of the contact
string forename The first name of the contact or interested party
string surname The last name of the contact or interested party
string email The email address The email address of the contact or interested party
string gender The gender of the contact or interested party
string birthday The birthday of the contact or interested party
int timestamp The timestamp when the newsletter email was sent to the contact or interested party
string templateLang The language of the newsletter's email template
int confirmedTimestamp The timestamp when the contact or interested party confirmed the newsletter subscription
string confirmAuthString The key that is automatically generated by the system. This key recognises the user regardless whether the user is logged in to the system and will then set the confirmation timestamp.

Methods

public toArray()

Returns this model as an array.

Recipient

The newsletter recipient

Namespace

Plenty\Modules\Account\Newsletter\Models

Properties

Type Name Description
int id The ID of the newsletter recipient
int folderId The ID of the newsletter folder
int contactId The ID of the contact
string firstName The first name of the recipient
string lastName The last name of the recipient
string email The email address of the recipient
string gender The gender of the recipient
string birthday The birthday of the recipient
int timestamp The timestamp when the newsletter email was sent to the recipient
string templateLang The language of the newsletter email template
int confirmedTimestamp The timestamp when the recipient confirmed the newsletter subscription
string confirmAuthString The key that is automatically generated by the system. This key recognises the user regardless whether the user is logged in to the system and will then set the confirmation timestamp.

Methods

public toArray()

Returns this model as an array.

OrderSummary

Contracts

OrderSummaryRepositoryContract

The OrderSummaryRepositoryContract is the interface for the order summary repository. This interface allows to list, get, update, create and delete order summaries.

Namespace

Plenty\Modules\Account\OrderSummary\Contracts

Methods

public findOrderSummaryById(int $orderSummaryId):OrderSummary

Gets an order summary. The ID of the order summary must be specified.

Parameters
int $orderSummaryId The ID of the order summary
public updateOrderSummary(array $data, int $orderSummaryId):OrderSummary

Updates an order summary. The ID of the order summary must be specified.

Parameters
array $data The order summary data as associative array
int $orderSummaryId The ID of the order summary
public createOrderSummary(array $data):OrderSummary

Creates an order summary.

Parameters
array $data The order summary data as associative array
public deleteOrderSummary(int $orderSummaryId):bool

Deletes an order summary. The ID of the order summary must be specified.

Parameters
int $orderSummaryId The ID of the order summary
public allOrderSummaries(array $columns = [], int $perPage = 50):Collection

Returns a collection of all order summaries.

Parameters
array $columns Optional: The columns to retrieve (Default: '[*]').
int $perPage Optional: The number of objects per page (Default: 50).
public findOrderSummaryByContactId(int $contactId):OrderSummary

Gets an order summary. The ID of the contact must be specified.

Parameters
int $contactId The ID of the contact
public findOrderSummaryByAddressId(int $addressId):OrderSummary

Gets an order summary. The ID of the address must be specified.

Parameters
int $addressId The ID of the address

Models

OrderSummary

The order summary model.

Namespace

Plenty\Modules\Account\OrderSummary\Models

Properties

Type Name Description
int id The ID of the order summary
int addressId The address ID of the order summary
int contactId The ID of the contact
int unpaidOrdersCount The number of unpaid orders
float unpaidOrderTotalAmount The total amount of unpaid orders
int orderCount The number of all orders of the associated model
string createdAt The time the order summary was created as unix timestamp
string updatedAt The time the order summary was last updated as unix timestamp

Methods

public toArray()

Returns this model as an array.