Devise
Class

Devise\Editor\EditorDataTranslator

class EditorDataTranslator

The translator's job is to translate input into something we can use for our views and other places.

This translator will also validate our input to ensure that things are still sane - so for example if you leave certain fields out then we cannot translate the babble.

Here is an example of the data coming in from inputData.

array(4) {
    ["coordinates"]=> array(2) {
        ["top"]=> string(3) "647"
        ["left"]=> string(5) "101.5"
    }

    ["categoryName"] => string(8) "Headings"
    ["categoryCount"] => string(1) "3"

    ["groups"]=> array(3) {
        ["Heading 1"]=> array(3) {
            [0]=> array(3) { ["key"]=> string(5) "title" ["type"]=> string(4) "text" ["humanName"]=> string(5) "Title" }
            [1]=> array(3) { ["key"]=> string(5) "title" ["type"]=> string(4) "text" ["humanName"]=> string(5) "Title" }
            [2]=> array(3) { ["key"]=> string(5) "title" ["type"]=> string(4) "text" ["humanName"]=> string(5) "Title" }
        }
    ["Heading 2"]=> array(3) {
        [0]=> array(3) { ["key"]=> string(5) "title" ["type"]=> string(4) "text" ["humanName"]=> string(5) "Title" }
            [1]=> array(3) { ["key"]=> string(5) "title" ["type"]=> string(4) "text" ["humanName"]=> string(5) "Title" }
            [2]=> array(3) { ["key"]=> string(5) "title" ["type"]=> string(4) "text" ["humanName"]=> string(5) "Title" }
        }
        ["Heading 3"]=> array(3) {
            [0]=> array(3) { ["key"]=> string(5) "title" ["type"]=> string(4) "text" ["humanName"]=> string(5) "Title" }
            [1]=> array(3) { ["key"]=> string(5) "title" ["type"]=> string(4) "text" ["humanName"]=> string(5) "Title" }
            [2]=> array(3) { ["key"]=> string(5) "title" ["type"]=> string(4) "text" ["humanName"]=> string(5) "Title" }
        }
    }
}

Here is an example of the data coming in from inputData when a collection is requested.

array(4) {
    ["coordinates"]=> array(2) {
        ["top"]=> string(3) "647"
        ["left"]=> string(5) "101.5"
    }

    ["categoryName"] => string(8) "Headings"
    ["categoryCount"] => string(1) "3"

    ["collection"]=> array(3) "towers"
    ["towers"]=> array(3) {
        [0]=> array(3) { ["key"]=> string(5) "title" ["type"]=> string(4) "text" ["humanName"]=> string(5) "Title" }
        [1]=> array(3) { ["key"]=> string(5) "color" ["type"]=> string(4) "text" ["humanName"]=> string(5) "Title" }
        [2]=> array(3) { ["key"]=> string(5) "wysiwyg" ["type"]=> string(4) "text" ["humanName"]=> string(5) "Title" }
    }
}

Methods

__construct(FieldManager $FieldManager, CollectionsManager $CollectionsManager)

EditorData translateFromInputArray(array $inputData)

Structures the data for the editor from array input

Details

at line 67
public __construct(FieldManager $FieldManager, CollectionsManager $CollectionsManager)

Parameters

FieldManager $FieldManager
CollectionsManager $CollectionsManager

at line 79
public EditorData translateFromInputArray(array $inputData)

Structures the data for the editor from array input

Parameters

array $inputData

Return Value

EditorData