Overview
  • Package
  • Class
  • Tree
  • Todo

Packages

  • AddonValue
    • Interfaces
  • AdminHttpViewControllers
  • ApiV2Controllers
  • Authentication
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Strategies
  • Category
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Providers
    • Repositories
    • Storages
  • Customer
    • Address
    • Country
    • CountryZone
    • Interfaces
    • Storages
    • Validation
    • ValueObjects
  • Email
    • Collections
    • Entities
    • Exceptions
    • Interfaces
    • Repository
    • ValueObjects
  • Extensions
    • Customers
    • Emails
    • Helpers
    • Invoices
    • Orders
    • Serializers
    • Templates
  • Http
    • Collections
    • Exceptions
    • Factories
    • Interfaces
    • ValueObjects
  • HttpViewControllers
  • InfoBox
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Repositories
  • Invoice
    • Interfaces
    • ValueObjects
  • Loaders
    • CrossCuttingLoader
    • GXCoreLoader
    • Interfaces
  • Modules
    • Collections
    • Controllers
    • Interfaces
  • None
  • Order
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Repositories
    • Storages
    • ValueObjects
  • Precheck
  • Product
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Providers
    • Repositories
    • Storages
  • ProductModule
    • Collections
    • Deleter
    • Entities
    • Factories
    • Interface
    • Interfaces
    • Reader
    • Repositories
    • Writer
  • Shared
    • ClassFinder
    • Exceptions
    • FileSystem
    • Interfaces
    • Storage
    • Types
  • SharedShoppingCart
    • Interfaces
  • Slider
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Repositories
    • Storages
  • Statistics
    • Interfaces
  • UserConfiguration
    • Interfaces
    • Repository

Classes

  • EmailParser

Class EmailParser

Class EmailParser

Handles the Email entity object parsing and encoding so that PHP can pass email records to JavaScript and vice versa. What it actually does is convert an email record into an array that can be encoded into JSON and parsed from JavaScript.

Package: Extensions\Emails
Category: System
Located at Extensions/Emails/EmailParser.inc.php

Methods summary

public
# __construct( EmailServiceInterface $emailService )

Class Constructor

Class Constructor

Parameters

$emailService
public EmailCollectionInterface
# parseCollection( array $encodedCollection )

Parse a JSON formatted email collection.

Parse a JSON formatted email collection.

When JavaScript makes AJAX requests to the server it will always sent a JSON formatted collection that contain email records. This collection will be parsed to an EmailCollection object in order to be used by methods inside the controller.

Parameters

$encodedCollection
JSON formatted email collection.

Returns

EmailCollectionInterface
Returns the parsed email collection object.
public EmailInterface
# parseEmail( array $encodedEmail )

Parse array that contains the email information sent by the JavaScript files.

Parse array that contains the email information sent by the JavaScript files.

Parameters

$encodedEmail
Contains the email information.

Returns

EmailInterface
Returns the equivalent email object.
public EmailContact
# parseContact( array $encodedContact )

Parse the contact data and return an EmailContact object.

Parse the contact data and return an EmailContact object.

Contact name is not a mandatory field so it might be empty as well.

Parameters

$encodedContact
Contains the "email_address", "contact_type" and "contact_name" keys.

Returns

EmailContact
Returns the parsed object.
public EmailAttachment
# parseAttachment( array $encodedAttachment )

Parse the contact data and return an EmailAttachment object.

Parse the contact data and return an EmailAttachment object.

Attachment name is not a mandatory field so it might be empty as well.

Parameters

$encodedAttachment
Contains the "path" and "name" keys.

Returns

EmailAttachment
Returns the parsed object.
public array
# encodeCollection( EmailCollectionInterface $collection )

Encode EmailCollection object to an array that can be later encoded into JSON string.

Encode EmailCollection object to an array that can be later encoded into JSON string.

Parameters

$collection
Contains the email objects to be encoded.

Returns

array
Returns an array that can be encoded to JSON and returned back to the client.
public array
# encodeEmail( EmailInterface $email )

Encode Email object that contains the email information to an array.

Encode Email object that contains the email information to an array.

The returned array can be then encoded into JSON and sent to the JavaScript code in the client's browser.

Parameters

$email
Contains the email information.

Returns

array
Returns the equivalent array.
public array
# encodeContact( EmailContactInterface $contact )

Convert an EmailContact object to an array.

Convert an EmailContact object to an array.

This conversions aims to help the JSON encoding of email contacts.

Parameters

$contact
Contains the contact information.

Returns

array
Encoded EmailContact object.
public array
# encodeAttachment( EmailAttachmentInterface $attachment )

Convert an EmailAttachment object to an array.

Convert an EmailAttachment object to an array.

This conversions aims to help the JSON encoding of email contacts.

Parameters

$attachment
Contains the attachment information.

Returns

array
Encoded EmailAttachment object.

Properties summary

protected EmailServiceInterface $emailService

Used for creating email objects.

Used for creating email objects.

#
API documentation generated by ApiGen